diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-07 16:28:27 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-27 08:20:43 +0000 |
commit | 644487a1152c7586a7f20c7f372572a71d8494d5 (patch) | |
tree | 683cdbd755ec1660e75f930e5be4cd6867e3e734 | |
parent | 1b4dff2c371d31c99f34324c3f6f31888bdc34d7 (diff) |
loplugin:unusedmethods
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861
Reviewed-on: https://gerrit.libreoffice.org/19231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
86 files changed, 74 insertions, 2630 deletions
diff --git a/chart2/source/inc/WeakListenerAdapter.hxx b/chart2/source/inc/WeakListenerAdapter.hxx index 2d215e35ecd1..4dd09ff8bfcd 100644 --- a/chart2/source/inc/WeakListenerAdapter.hxx +++ b/chart2/source/inc/WeakListenerAdapter.hxx @@ -59,7 +59,7 @@ protected: // ____ XEventListener (base of all listeners) ____ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) - throw (::com::sun::star::uno::RuntimeException) + throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > xEventListener = diff --git a/comphelper/source/misc/numbers.cxx b/comphelper/source/misc/numbers.cxx index 29b460641b98..ef2af9038c23 100644 --- a/comphelper/source/misc/numbers.cxx +++ b/comphelper/source/misc/numbers.cxx @@ -80,20 +80,6 @@ css::uno::Any getNumberFormatDecimals(const css::uno::Reference<css::util::XNumb -sal_Int32 getStandardFormat( - const css::uno::Reference<css::util::XNumberFormatter>& xFormatter, - sal_Int16 nType, - const css::lang::Locale& _rLocale) -{ - css::uno::Reference<css::util::XNumberFormatsSupplier> xSupplier( xFormatter.is() ? xFormatter->getNumberFormatsSupplier() : css::uno::Reference<css::util::XNumberFormatsSupplier>(NULL)); - css::uno::Reference<css::util::XNumberFormats> xFormats( xSupplier.is() ? xSupplier->getNumberFormats() : css::uno::Reference<css::util::XNumberFormats>(NULL)); - css::uno::Reference<css::util::XNumberFormatTypes> xTypes(xFormats, css::uno::UNO_QUERY); - OSL_ENSURE(xTypes.is(), "getStandardFormat : no format types !"); - - return xTypes.is() ? xTypes->getStandardFormat(nType, _rLocale) : 0; -} - - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx index a5550312e155..3a9209b69b2b 100644 --- a/compilerplugins/clang/unusedmethods.cxx +++ b/compilerplugins/clang/unusedmethods.cxx @@ -251,7 +251,7 @@ bool UnusedMethods::VisitFunctionDecl( const FunctionDecl* functionDecl ) if (isa<CXXConstructorDecl>(functionDecl)) { return true; } - if (methodDecl && methodDecl->isDeleted()) { + if (functionDecl && functionDecl->isDeleted()) { return true; } diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py index fd17cb5c2f7d..0c2cdff7f640 100755 --- a/compilerplugins/clang/unusedmethods.py +++ b/compilerplugins/clang/unusedmethods.py @@ -7,6 +7,7 @@ import io definitionSet = set() definitionToSourceLocationMap = dict() callSet = set() +sourceLocationSet = set() # things we need to exclude for reasons like : # - it's a weird template thingy that confuses the plugin exclusionSet = set([ @@ -101,6 +102,8 @@ exclusionSet = set([ "void ImportXE(class SwDoc &,class SwPaM &,const class rtl::OUString &)", "_Bool TestImportDOC(const class rtl::OUString &,const class rtl::OUString &)", "class vcl::Window * CreateWindow(class VCLXWindow **,const struct com::sun::star::awt::WindowDescriptor *,class vcl::Window *,long)", + # only used when the ODBC driver is enabled + "_Bool getImplementation(type-parameter-?-? *&,const class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface> &)", ]) # clang does not always use exactly the same numbers in the type-parameter vars it generates @@ -123,6 +126,18 @@ with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt: idx1 = line.find("\t",6) callSet.add((normalizeTypeParams(line[6:idx1]), normalizeTypeParams(line[idx1+1:].strip()))) +# Invert the definitionToSourceLocationMap +# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template +# and we should just ignore +sourceLocationToDefinitionMap = {} +for k, v in definitionToSourceLocationMap.iteritems(): + sourceLocationToDefinitionMap[v] = sourceLocationToDefinitionMap.get(v, []) + sourceLocationToDefinitionMap[v].append(k) +for k, definitions in sourceLocationToDefinitionMap.iteritems(): + if len(definitions) > 1: + for d in definitions: + definitionSet.remove(d) + tmp1set = set() for d in definitionSet: clazz = d[0] + " " + d[1] @@ -199,6 +214,8 @@ for d in definitionSet: # ignore methods used to dump objects to stream - normally used for debugging if d[0] == "class std::basic_ostream<char> &" and d[1].startswith("operator<<(class std::basic_ostream<char> &"): continue + if d[0] == "basic_ostream<type-parameter-?-?, type-parameter-?-?> &" and d[1].startswith("operator<<(basic_ostream<type-parameter-?-?"): + continue tmp1set.add((clazz, definitionToSourceLocationMap[d])) diff --git a/connectivity/source/inc/java/tools.hxx b/connectivity/source/inc/java/tools.hxx index 79ad248bfa16..ec69c29cb428 100644 --- a/connectivity/source/inc/java/tools.hxx +++ b/connectivity/source/inc/java/tools.hxx @@ -61,7 +61,6 @@ namespace connectivity return xOut; } - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > Map2XNameAccess(JNIEnv *pEnv,jobject _pMap); jobject convertTypeMapToJavaMap(JNIEnv *pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & _rMap); /** return if a exception occurred diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 500f7dfeb471..086b57a841ad 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -449,63 +449,6 @@ void OFieldDescControl::SetReadOnly( bool bReadOnly ) } } -OUString OFieldDescControl::GetControlText( sal_uInt16 nControlId ) -{ - // Read out the Controls' texts - switch( nControlId ) - { - case FIELD_PROPERTY_BOOL_DEFAULT: - if (pBoolDefault) - return pBoolDefault->GetSelectEntry(); - break; - case FIELD_PROPERTY_DEFAULT: - if (pDefault) - return pDefault->GetText(); - break; - case FIELD_PROPERTY_REQUIRED: - if (pRequired) - return pRequired->GetSelectEntry(); - break; - case FIELD_PROPERTY_TEXTLEN: - if (pTextLen) - return OUString::number(pTextLen->GetValue()); - break; - case FIELD_PROPERTY_NUMTYPE: - if (pNumType) - return pNumType->GetSelectEntry(); - break; - case FIELD_PROPERTY_AUTOINC: - if (pAutoIncrement) - return pAutoIncrement->GetSelectEntry(); - break; - case FIELD_PROPERTY_LENGTH: - if (pLength) - return pLength->GetText(); - break; - case FIELD_PROPERTY_SCALE: - if (pScale) - return pScale->GetText(); - break; - case FIELD_PROPERTY_FORMAT: - if (pFormatSample) - return pFormatSample->GetText(); - break; - case FIELD_PROPERTY_COLUMNNAME: - if(m_pColumnName) - return m_pColumnName->GetText(); - break; - case FIELD_PROPERTY_TYPE: - if(m_pType) - return m_pType->GetSelectEntry(); - break; - case FIELD_PROPERTY_AUTOINCREMENT: - if(m_pAutoIncrementValue) - return m_pAutoIncrementValue->GetText(); - } - - return OUString(); -} - void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const OUString& rText ) { // Set the Controls' texts diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 16d2ca9f8180..e18d5b1bee08 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -182,7 +182,6 @@ namespace dbaui void SaveData( OFieldDescription* pFieldDescr ); void SetControlText( sal_uInt16 nControlId, const OUString& rText ); - OUString GetControlText( sal_uInt16 nControlId ); void SetReadOnly( bool bReadOnly ); // when resize is called diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 5d519344c52d..025b59ade6e1 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -289,15 +289,6 @@ sal_Int32 ExtensionBox_Impl::getSelIndex() const } -void ExtensionBox_Impl::checkIndex( sal_Int32 nIndex ) const -{ - if ( nIndex < 0 ) - throw lang::IllegalArgumentException( "The list index starts with 0",0, 0 ); - if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size()) - throw lang::IllegalArgumentException( "There is no element at the provided position. The position exceeds the number of available list entries",0, 0 ); -} - - // Title + description void ExtensionBox_Impl::CalcActiveHeight( const long nPos ) { diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index b6db33572548..eaf4f401554c 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -165,11 +165,6 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox DECL_DLLPRIVATE_LINK_TYPED( ScrollHdl, ScrollBar*, void ); - //Index starts with 1. - //Throws an css::lang::IllegalArgumentException, when the index is invalid. - void checkIndex(sal_Int32 pos) const; - - void Init(); public: explicit ExtensionBox_Impl(vcl::Window* pParent); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 1b333a7b5ffa..2c330c7659dd 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -104,20 +104,6 @@ css::uno::Reference< css::datatransfer::XTransferable > TextChainingUtils::Creat } -/* Helper functions for *OverflowingText classes */ - -ESelection getLastPositionSel(const EditTextObject *pTObj) -{ - sal_Int32 nLastPara = pTObj->GetParagraphCount()-1; - // If text is empty - if (nLastPara < 0 ) - nLastPara = 0; - sal_Int32 nLen = pTObj->GetText(nLastPara).getLength(); - ESelection aEndPos(nLastPara, nLen, nLastPara, nLen); - - return aEndPos; -} - // class OverflowingText OverflowingText::OverflowingText(css::uno::Reference< css::datatransfer::XTransferable > xOverflowingContent) : @@ -127,12 +113,6 @@ OverflowingText::OverflowingText(css::uno::Reference< css::datatransfer::XTransf } -ESelection OverflowingText::GetInsertionPointSel() -{ - assert(false && "You should never get here"); - return getLastPositionSel(NULL); -} - // class NonOverflowingText NonOverflowingText::NonOverflowingText(const EditTextObject * /*pTObj*/, bool bLastParaInterrupted) diff --git a/forms/source/xforms/datatypes.hxx b/forms/source/xforms/datatypes.hxx index ef1bee4dbda0..ae5e32085d11 100644 --- a/forms/source/xforms/datatypes.hxx +++ b/forms/source/xforms/datatypes.hxx @@ -234,11 +234,11 @@ namespace xforms protected: // OPropertyArrayUsageHelper - virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE; // XPropertySet - virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException); - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException) SAL_OVERRIDE; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; }; class OBooleanType; diff --git a/include/canvas/canvastools.hxx b/include/canvas/canvastools.hxx index 4ac2624833ac..2085915b6803 100644 --- a/include/canvas/canvastools.hxx +++ b/include/canvas/canvastools.hxx @@ -112,24 +112,6 @@ namespace canvas inline unsigned int pow2( unsigned int c ) { return 0x1 << c; } inline unsigned int mask( unsigned int c ) { return ((unsigned int)(-1)) / (pow2(pow2(c)) + 1); } inline unsigned int count( unsigned int x, unsigned int c ) { return ((x) & mask(c)) + (((x) >> (pow2(c))) & mask(c)); } - template<typename T> - inline unsigned int bitcount( T c ) { - unsigned int nByteIndex = 0; - unsigned int nNumBytes = sizeof(T)<<2; - do { - c=count(c,nByteIndex++); - nNumBytes >>= 1; - } while(nNumBytes); - return c; - } - inline sal_uInt32 bitcount32( sal_uInt32 c ) { - c=count(c,0); - c=count(c,1); - c=count(c,2); - c=count(c,3); - c=count(c,4); - return c; - } /** Round given floating point value down to next integer */ diff --git a/include/comphelper/numbers.hxx b/include/comphelper/numbers.hxx index 7ed2e2b4190d..5b3684767215 100644 --- a/include/comphelper/numbers.hxx +++ b/include/comphelper/numbers.hxx @@ -38,13 +38,6 @@ namespace comphelper /// returns the decimals of the given numeric number formatunder the given formats COMPHELPER_DLLPUBLIC css::uno::Any getNumberFormatDecimals(const css::uno::Reference<css::util::XNumberFormats>& xFormats, sal_Int32 nKey); - /** returns the standard format for the given type and the given _rLocale - */ - sal_Int32 getStandardFormat( - const css::uno::Reference<css::util::XNumberFormatter>& xFormatter, - sal_Int16 nType, - const css::lang::Locale& _rLocale); - /** retrieves a the value of a given property for a given format key, relating to a given formatter */ COMPHELPER_DLLPUBLIC css::uno::Any getNumberFormatProperty( diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx index fc825f6ff35c..90b1e3e4384e 100644 --- a/include/comphelper/string.hxx +++ b/include/comphelper/string.hxx @@ -222,12 +222,6 @@ namespace detail @return rBuf; */ -inline OStringBuffer& truncateToLength( - OStringBuffer& rBuffer, sal_Int32 nLength) -{ - return detail::truncateToLength(rBuffer, nLength); -} - inline OUStringBuffer& truncateToLength( OUStringBuffer& rBuffer, sal_Int32 nLength) { diff --git a/include/connectivity/TTableHelper.hxx b/include/connectivity/TTableHelper.hxx index b76c0527109c..9fab6e60220a 100644 --- a/include/connectivity/TTableHelper.hxx +++ b/include/connectivity/TTableHelper.hxx @@ -73,8 +73,6 @@ namespace connectivity }; typedef connectivity::sdbcx::OTable OTable_TYPEDEF; - OOO_DLLPUBLIC_DBTOOLS OUString getTypeString(const css::uno::Reference< css::beans::XPropertySet >& xColProp); - typedef std::map<OUString, sdbcx::TKeyProperties> TKeyMap; struct OTableHelperImpl; diff --git a/include/cppcanvas/color.hxx b/include/cppcanvas/color.hxx index 1fe31064be29..678e431d0846 100644 --- a/include/cppcanvas/color.hxx +++ b/include/cppcanvas/color.hxx @@ -69,11 +69,6 @@ namespace cppcanvas return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha); } - inline sal_Int32 unMakeColor( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue) - { - return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue); - } - inline sal_Int32 makeColorARGB( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue) { return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue); diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 342006459145..a8fa5a6e85c2 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -71,7 +71,6 @@ class OverflowingText public: OutlinerParaObject *JuxtaposeParaObject(Outliner *, OutlinerParaObject *); OutlinerParaObject *DeeplyMergeParaObject(Outliner *, OutlinerParaObject *); - static ESelection GetInsertionPointSel(); private: friend class Outliner; diff --git a/include/jvmaccess/classpath.hxx b/include/jvmaccess/classpath.hxx index 9265cd68a9b3..d5db39d941d7 100644 --- a/include/jvmaccess/classpath.hxx +++ b/include/jvmaccess/classpath.hxx @@ -69,36 +69,6 @@ JVMACCESS_DLLPUBLIC jobjectArray translateToUrls( css::uno::Reference<css::uno::XComponentContext> const & context, JNIEnv * environment, OUString const & classPath); -/** - loads a class via a java.net.URLClassLoader. - - @param context - a component context; must not be null. - - @param environment - a JNI environment; must not be null. - - @param classPath - a list of zero or more internal (see the - com.sun.star.uri.ExternalUriReferenceTranslator service) URI references, - where any space characters (U+0020) are ignored (and, in particular, separate - adjacent URI references). Any vnd.sun.star.expand URL references in the list - are expanded using the com.sun.star.util.theMacroExpander singleton of the - given context. - - @param name - the Java binary name of the class to load. - - @returns - a local reference to a java.lang.Class instance. If null, a (still pending) - JNI exception occurred. - - @throws com::sun::star::uno::RuntimeException - */ -JVMACCESS_DLLPUBLIC jclass loadClass( - css::uno::Reference<css::uno::XComponentContext> const & context, - JNIEnv * environment, OUString const & classPath, OUString const & name); - } } diff --git a/include/jvmfwk/framework.h b/include/jvmfwk/framework.h index 16c8d0c7311c..acd2cb1ab383 100644 --- a/include/jvmfwk/framework.h +++ b/include/jvmfwk/framework.h @@ -726,30 +726,6 @@ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** */ JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation); -/** obtains an array containing paths to JRE installations. - - <p> - It is not guaranteed that the returned paths represent - a valid JRE. One can use <code>jfw_getJavaInfoByPath</code> to check this. - </p> - - @param parLocations - [out] on return it contains the array of paths. - @param pSize - [out] on return it contains the size of the array <code>parLocations</code>. - - @return - JFW_E_NONE function ran successfully.<br/> - JFW_E_INVALIDARG parLocation is NULL or pSize is NULL.<br/> - JFW_E_ERROR An error occurred.<br/> - JFW_E_CONFIGURATION mode was not properly set or their prerequisites - were not met.<br/> - JFW_E_DIRECT_MODE the function cannot be used in this mode. - */ -JVMFWK_DLLPUBLIC javaFrameworkError SAL_CALL jfw_getJRELocations( - rtl_uString *** parLocations, sal_Int32 * pSize); - - /** checks if the installation of the jre still exists. This function checks if the JRE described by pInfo still diff --git a/include/oox/helper/containerhelper.hxx b/include/oox/helper/containerhelper.hxx index 9894c0040d18..2016d3dee55a 100644 --- a/include/oox/helper/containerhelper.hxx +++ b/include/oox/helper/containerhelper.hxx @@ -240,36 +240,18 @@ public: static const typename VectorType::value_type& getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault ); - /** Returns the reference to an existing element of the passed vector, or - the passed default value, if the passed index is out of bounds. */ - template< typename VectorType > - static typename VectorType::value_type& - getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ); - /** Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. */ template< typename MapType > static const typename MapType::mapped_type* getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ); - /** Returns the pointer to an existing element of the passed map, or a null - pointer, if an element with the passed key does not exist. */ - template< typename MapType > - static typename MapType::mapped_type* - getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ); - /** Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. */ template< typename MapType > static const typename MapType::mapped_type& getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ); - /** Returns the reference to an existing element of the passed map, or the - passed default value, if an element with the passed key does not exist. */ - template< typename MapType > - static typename MapType::mapped_type& - getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ); - // vector/map/matrix to UNO sequence -------------------------------------- /** Creates a UNO sequence from a std::vector with copies of all elements. @@ -316,12 +298,6 @@ template< typename VectorType > return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; } -template< typename VectorType > -/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault ) -{ - return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault; -} - template< typename MapType > /*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey ) { @@ -330,26 +306,12 @@ template< typename MapType > } template< typename MapType > -/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey ) -{ - typename MapType::iterator aIt = rMap.find( rKey ); - return (aIt == rMap.end()) ? 0 : &aIt->second; -} - -template< typename MapType > /*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault ) { typename MapType::const_iterator aIt = rMap.find( rKey ); return (aIt == rMap.end()) ? rDefault : aIt->second; } -template< typename MapType > -/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault ) -{ - typename MapType::iterator aIt = rMap.find( rKey ); - return (aIt == rMap.end()) ? rDefault : aIt->second; -} - template< typename VectorType > /*static*/ css::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector ) { diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx index f36e6325ebd9..516c7a2567b4 100644 --- a/include/oox/helper/helper.hxx +++ b/include/oox/helper/helper.hxx @@ -166,19 +166,6 @@ inline void setFlag( Type& ornBitField, Type nMask, bool bSet = true ) if( bSet ) ornBitField |= nMask; else ornBitField &= ~nMask; } -/** Inserts a value into a bitfield. - - Inserts the lower nBitCount bits of nValue into ornBitField, starting - there at bit nStartBit. Other contents of ornBitField keep unchanged. - */ -template< typename Type, typename InsertType > -void insertValue( Type& ornBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount ) -{ - sal_uInt64 nMask = 1; nMask <<= nBitCount; --nMask; - Type nNewValue = static_cast< Type >( nValue & nMask ); - (ornBitField &= ~(nMask << nStartBit)) |= (nNewValue << nStartBit); -} - /** Optional value, similar to ::boost::optional<>, with convenience accessors. @@ -198,7 +185,6 @@ public: const Type& get() const { return maValue; } const Type& get( const Type& rDefValue ) const { return mbHasValue ? maValue : rDefValue; } - void reset() { mbHasValue = false; } void set( const Type& rValue ) { maValue = rValue; mbHasValue = true; } Type& use() { mbHasValue = true; return maValue; } @@ -256,13 +242,6 @@ public: #endif - /** Reads a value from memory, assuming memory buffer in little-endian. - @param ornValue (out-parameter) Contains the value read from memory. - @param pSrcBuffer The memory buffer to read the value from. - */ - template< typename Type > - inline static void readLittleEndian( Type& ornValue, const void* pSrcBuffer ); - /** Writes a value to memory, while converting it to little-endian. @param pDstBuffer The memory buffer to write the value to. @param nValue The value to be written to memory in little-endian. @@ -281,13 +260,6 @@ private: template< typename Type > -inline void ByteOrderConverter::readLittleEndian( Type& ornValue, const void* pSrcBuffer ) -{ - memcpy( &ornValue, pSrcBuffer, sizeof( Type ) ); - convertLittleEndian( ornValue ); -} - -template< typename Type > inline void ByteOrderConverter::writeLittleEndian( void* pDstBuffer, Type nValue ) { convertLittleEndian( nValue ); diff --git a/include/oox/helper/refmap.hxx b/include/oox/helper/refmap.hxx index e3efbfa4f961..1a40634fa117 100644 --- a/include/oox/helper/refmap.hxx +++ b/include/oox/helper/refmap.hxx @@ -82,14 +82,6 @@ public: /** Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType > - void forEachMem( FuncType pFunc, ParamType aParam ) const - { - forEach( ::boost::bind( pFunc, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const { @@ -104,14 +96,6 @@ public: forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); } - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > - void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); - } - /** Calls the passed functor for every contained object. Passes the key as first argument and the object reference as second argument to rFunctor. */ @@ -129,29 +113,6 @@ public: forEachWithKey( ::boost::bind( pFunc, _2, _1 ) ); } - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType > - void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2 > - void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the object key as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } private: template< typename FunctorType > diff --git a/include/oox/helper/refvector.hxx b/include/oox/helper/refvector.hxx index b98d961e203f..eff649b718b0 100644 --- a/include/oox/helper/refvector.hxx +++ b/include/oox/helper/refvector.hxx @@ -54,10 +54,6 @@ public: return value_type(); } - /** Returns the index of the last element, or -1, if the vector is empty. - Does *not* check whether the last element is an empty reference. */ - sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; } - /** Calls the passed functor for every contained object, automatically skips all elements that are empty references. */ template< typename FunctorType > @@ -107,22 +103,6 @@ public: } /** Calls the passed member function of ObjType on every contained object. - Passes the vector index to the member function. */ - template< typename FuncType > - void forEachMemWithIndex( FuncType pFunc ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) ); - } - - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType > - void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) ); - } - - /** Calls the passed member function of ObjType on every contained object. Passes the vector index as first argument to the member function. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const @@ -130,14 +110,6 @@ public: forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) ); } - /** Calls the passed member function of ObjType on every contained object. - Passes the vector index as first argument to the member function. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > - void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const - { - forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) ); - } - /** Searches for an element by using the passed functor that takes a constant reference of the object type (const ObjType&). */ template< typename FunctorType > diff --git a/include/oox/ole/axbinarywriter.hxx b/include/oox/ole/axbinarywriter.hxx index 3efd418dea64..ae3cdc124a45 100644 --- a/include/oox/ole/axbinarywriter.hxx +++ b/include/oox/ole/axbinarywriter.hxx @@ -59,9 +59,6 @@ public: /** Aligns the stream according to the passed type and reads a value. */ template< typename Type > void writeAligned( Type nVal ) { align( sizeof( Type ) ); writeValue( nVal ); } - /** Aligns the stream according to the passed type and skips the size of the type. */ - template< typename Type > - void padAligned() { align( sizeof( Type ) ); pad( sizeof( Type ) ); } private: BinaryOutputStream* mpOutStrm; ///< The wrapped input stream. diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx index 6b2c3c67940f..cea21146d36c 100644 --- a/include/oox/vml/vmlshapecontainer.hxx +++ b/include/oox/vml/vmlshapecontainer.hxx @@ -75,10 +75,6 @@ public: @param bDeep True = searches in all group shapes too. */ const ShapeBase* getShapeById( const OUString& rShapeId, bool bDeep ) const; - /** Searches for a shape type by using the passed functor that takes a - constant reference of a ShapeType object. */ - template< typename Functor > - const ShapeType* findShapeType( const Functor& rFunctor ) const; /** Searches for a shape by using the passed functor that takes a constant reference of a ShapeBase object. */ template< typename Functor > @@ -132,12 +128,6 @@ ShapeT& ShapeContainer::createShape() } template< typename Functor > -const ShapeType* ShapeContainer::findShapeType( const Functor& rFunctor ) const -{ - return maTypes.findIf( rFunctor ).get(); -} - -template< typename Functor > const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const { return maShapes.findIf( rFunctor ).get(); diff --git a/include/sfx2/controlwrapper.hxx b/include/sfx2/controlwrapper.hxx index d99035758a06..b9865f8a541d 100644 --- a/include/sfx2/controlwrapper.hxx +++ b/include/sfx2/controlwrapper.hxx @@ -279,11 +279,11 @@ public: inline explicit NumericFieldWrapper( NumericField& rField ) : SingleControlWrapper< NumericField, ValueT >( rField ) {} - virtual bool IsControlDontKnow() const; - virtual void SetControlDontKnow( bool bSet ); + virtual bool IsControlDontKnow() const SAL_OVERRIDE; + virtual void SetControlDontKnow( bool bSet ) SAL_OVERRIDE; - virtual ValueT GetControlValue() const; - virtual void SetControlValue( ValueT nValue ); + virtual ValueT GetControlValue() const SAL_OVERRIDE; + virtual void SetControlValue( ValueT nValue ) SAL_OVERRIDE; }; @@ -309,11 +309,11 @@ public: inline explicit MetricFieldWrapper( MetricField& rField, FieldUnit eUnit = FUNIT_NONE ) : SingleControlWrapper< MetricField, ValueT >( rField ), meUnit( eUnit ) {} - virtual bool IsControlDontKnow() const; - virtual void SetControlDontKnow( bool bSet ); + virtual bool IsControlDontKnow() const SAL_OVERRIDE; + virtual void SetControlDontKnow( bool bSet ) SAL_OVERRIDE; - virtual ValueT GetControlValue() const; - virtual void SetControlValue( ValueT nValue ); + virtual ValueT GetControlValue() const SAL_OVERRIDE; + virtual void SetControlValue( ValueT nValue ) SAL_OVERRIDE; private: FieldUnit meUnit; @@ -353,13 +353,13 @@ public: inline explicit ListBoxWrapper( ListBox& rListBox, const MapEntryType* pMap = 0 ) : SingleControlWrapper< ListBox, ValueT >( rListBox ), MapperType( WRAPPER_LISTBOX_ENTRY_NOTFOUND, pMap ) {} - virtual bool IsControlDontKnow() const + virtual bool IsControlDontKnow() const SAL_OVERRIDE { return this->GetControl().GetSelectEntryCount() == 0; } - virtual void SetControlDontKnow( bool bSet ) + virtual void SetControlDontKnow( bool bSet ) SAL_OVERRIDE { if( bSet ) this->GetControl().SetNoSelection(); } - virtual ValueT GetControlValue() const; - virtual void SetControlValue( ValueT nValue ); + virtual ValueT GetControlValue() const SAL_OVERRIDE; + virtual void SetControlValue( ValueT nValue ) SAL_OVERRIDE; }; @@ -395,13 +395,13 @@ public: inline explicit ValueSetWrapper( ValueSet& rValueSet, const MapEntryType* pMap = 0 ) : SingleControlWrapper< ValueSet, ValueT >( rValueSet ), MapperType( WRAPPER_VALUESET_ITEM_NOTFOUND, pMap ) {} - virtual bool IsControlDontKnow() const + virtual bool IsControlDontKnow() const SAL_OVERRIDE { return this->GetControl().IsNoSelection(); } - virtual void SetControlDontKnow( bool bSet ) + virtual void SetControlDontKnow( bool bSet ) SAL_OVERRIDE { if( bSet ) this->GetControl().SetNoSelection(); } - virtual ValueT GetControlValue() const; - virtual void SetControlValue( ValueT nValue ); + virtual ValueT GetControlValue() const SAL_OVERRIDE; + virtual void SetControlValue( ValueT nValue ) SAL_OVERRIDE; }; diff --git a/include/sfx2/itemwrapper.hxx b/include/sfx2/itemwrapper.hxx index 594bcd4440ca..ed22fae42532 100644 --- a/include/sfx2/itemwrapper.hxx +++ b/include/sfx2/itemwrapper.hxx @@ -139,9 +139,9 @@ public: virtual ~ValueItemWrapper() {} - virtual ValueT GetItemValue( const ItemT& rItem ) const + virtual ValueT GetItemValue( const ItemT& rItem ) const SAL_OVERRIDE { return static_cast< ValueT >( rItem.GetValue() ); } - virtual void SetItemValue( ItemT& rItem, ValueT aValue ) const + virtual void SetItemValue( ItemT& rItem, ValueT aValue ) const SAL_OVERRIDE { rItem.SetValue( static_cast< InternalValueT >( aValue ) ); } }; @@ -164,9 +164,9 @@ public: virtual ~IdentItemWrapper() {} - virtual const ItemT& GetItemValue( const ItemT& rItem ) const + virtual const ItemT& GetItemValue( const ItemT& rItem ) const SAL_OVERRIDE { return rItem; } - virtual void SetItemValue( ItemT& rItem, const ItemT& rValue ) const + virtual void SetItemValue( ItemT& rItem, const ItemT& rValue ) const SAL_OVERRIDE { rItem = rValue; } }; diff --git a/include/store/store.h b/include/store/store.h index 6b00241d0979..61dc1e177d9e 100644 --- a/include/store/store.h +++ b/include/store/store.h @@ -110,42 +110,6 @@ STORE_DLLPUBLIC storeError SAL_CALL store_flushFile ( ) SAL_THROW_EXTERN_C(); -/** Get the number of referers to a file. - @param hFile [in] the File Handle. - @param pnRefCount [out] number of open directories and streams. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_getFileRefererCount ( - storeFileHandle hFile, - sal_uInt32 *pnRefCount -) SAL_THROW_EXTERN_C(); - - -/** Get the size of a file. - @param hFile [in] the File Handle. - @param pnSize [out] the file size in bytes. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_getFileSize ( - storeFileHandle hFile, - sal_uInt32 *pnSize -) SAL_THROW_EXTERN_C(); - - -/** Recover and Compact a file into another file. - @see store_openFile() - - @param pSrcFilename [in] opened with store_AccessReadOnly. - @param pDstFilename [in] created with store_AccessCreate. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_rebuildFile ( - rtl_uString *pSrcFilename, - rtl_uString *pDstFilename -) SAL_THROW_EXTERN_C(); - - - /** Directory Handle opaque type. */ typedef void* storeDirectoryHandle; @@ -170,16 +134,6 @@ STORE_DLLPUBLIC storeError SAL_CALL store_openDirectory ( ) SAL_THROW_EXTERN_C(); -/** Close a directory. - @param hDirectory [in] the Directory Handle. - @return store_E_None upon success, - store_E_InvalidHandle otherwise. - */ -STORE_DLLPUBLIC storeError SAL_CALL store_closeDirectory ( - storeDirectoryHandle hDirectory -) SAL_THROW_EXTERN_C(); - - /** Find first directory entry. @param hDirectory [in] the Directory Handle. @param pFindData [out] the Find Data structure. @@ -229,16 +183,6 @@ STORE_DLLPUBLIC storeError SAL_CALL store_openStream ( ) SAL_THROW_EXTERN_C(); -/** Close a stream. - @param hStrm [in] the Stream Handle. - @return store_E_None upon success, - store_E_InvalidHandle otherwise. - */ -STORE_DLLPUBLIC storeError SAL_CALL store_closeStream ( - storeStreamHandle hStrm -) SAL_THROW_EXTERN_C(); - - /** Read from a stream. @param hStrm [in] the Stream Handle. @param nOffset [in] the offset of the first byte to read. @@ -273,109 +217,6 @@ STORE_DLLPUBLIC storeError SAL_CALL store_writeStream ( ) SAL_THROW_EXTERN_C(); -/** Flush a stream. - @param hStrm [in] the Stream Handle. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_flushStream ( - storeStreamHandle hStrm -) SAL_THROW_EXTERN_C(); - - -/** Get the size of a stream. - @param hStrm [in] the Stream Handle. - @param pnSize [out] the stream size in bytes. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_getStreamSize ( - storeStreamHandle hStrm, - sal_uInt32 *pnSize -) SAL_THROW_EXTERN_C(); - - -/** Set the size of a stream. - @param hStrm [in] the Stream Handle. - @param nSize [in] the new stream size in bytes. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_setStreamSize ( - storeStreamHandle hStrm, - sal_uInt32 nSize -) SAL_THROW_EXTERN_C(); - - - -/** Set attributes of a file entry. - @param hFile [in] the File Handle. - @param pPath [in] the entry path. - @param pName [in] the entry name. - @param nMask1 [in] the attributes to be cleared. - @param nMask2 [in] the attributes to be set. - @param pnAttrib [out] the resulting attributes, may be NULL. - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_attrib ( - storeFileHandle hFile, - rtl_uString *pPath, - rtl_uString *pName, - sal_uInt32 nMask1, - sal_uInt32 nMask2, - sal_uInt32 *pnAttrib -) SAL_THROW_EXTERN_C(); - - -/** Insert a file entry as 'hard link' to another file entry. - @pre Source must not exist, Destination must exist. - @post Source has attribute STORE_ATTRIB_ISLINK. - @see store_attrib() - - @param hFile [in] the File Handle - @param pSrcPath [in] the Source path - @param pSrcName [in] the Source name - @param pDstPath [in] the Destination path - @param pDstName [in] the Destination name - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_link ( - storeFileHandle hFile, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C(); - - -/** Insert a file entry as 'symbolic link' to another file entry. - @pre Source must not exist - @post Source has attribute STORE_ATTRIB_ISLINK. - @see store_attrib() - - @param hFile [in] the File Handle - @param pSrcPath [in] the Source path - @param pSrcName [in] the Source name - @param pDstPath [in] the Destination path - @param pDstName [in] the Destination name - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_symlink ( - storeFileHandle hFile, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C(); - - -/** Rename a file entry. - @param hFile [in] the File Handle - @param pSrcPath [in] the Source path - @param pSrcName [in] the Source name - @param pDstPath [in] the Destination path - @param pDstName [in] the Destination name - @return store_E_None upon success - */ -STORE_DLLPUBLIC storeError SAL_CALL store_rename ( - storeFileHandle hFile, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C(); - /** Remove a file entry. @param hFile [in] the File Handle diff --git a/include/store/store.hxx b/include/store/store.hxx index 1c148a292a2d..2de8b5b0b98b 100644 --- a/include/store/store.hxx +++ b/include/store/store.hxx @@ -105,18 +105,6 @@ public: return store_openStream (hFile, rPath.pData, rName.pData, eMode, &m_hImpl); } - /** Close the stream. - @see store_closeStream() - */ - inline void close() - { - if (m_hImpl) - { - (void) store_closeStream (m_hImpl); - m_hImpl = 0; - } - } - /** Read from the stream. @see store_readStream() */ @@ -147,39 +135,6 @@ public: return store_writeStream (m_hImpl, nOffset, pBuffer, nBytes, &rnDone); } - /** Flush the stream. - @see store_flushStream() - */ - inline storeError flush() const - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_flushStream (m_hImpl); - } - - /** Get the stream size. - @see store_getStreamSize() - */ - inline storeError getSize (sal_uInt32 & rnSize) const - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_getStreamSize (m_hImpl, &rnSize); - } - - /** Set the stream size. - @see store_setStreamSize() - */ - inline storeError setSize (sal_uInt32 nSize) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_setStreamSize (m_hImpl, nSize); - } - private: /** Representation. */ @@ -262,18 +217,6 @@ public: return store_openDirectory (hFile, rPath.pData, rName.pData, eMode, &m_hImpl); } - /** Close the directory. - @see store_closeDirectory() - */ - inline void close() - { - if (m_hImpl) - { - (void) store_closeDirectory (m_hImpl); - m_hImpl = 0; - } - } - /** Directory iterator type. @see first() @see next() @@ -428,99 +371,6 @@ public: return store_flushFile (m_hImpl); } - /** Get the number of referers to the file. - @see store_getFileRefererCount() - */ - inline storeError getRefererCount (sal_uInt32 & rnRefCount) const - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_getFileRefererCount (m_hImpl, &rnRefCount); - } - - /** Get the file size. - @see store_getFileSize() - */ - inline storeError getSize (sal_uInt32 & rnSize) const - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_getFileSize (m_hImpl, &rnSize); - } - - /** Set attributes of a file entry. - @see store_attrib() - */ - inline storeError attrib ( - rtl::OUString const & rPath, - rtl::OUString const & rName, - sal_uInt32 nMask1, - sal_uInt32 nMask2, - sal_uInt32 & rnAttrib) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_attrib (m_hImpl, rPath.pData, rName.pData, nMask1, nMask2, &rnAttrib); - } - - /** Set attributes of a file entry. - @see store_attrib() - */ - inline storeError attrib ( - rtl::OUString const & rPath, - rtl::OUString const & rName, - sal_uInt32 nMask1, - sal_uInt32 nMask2) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_attrib (m_hImpl, rPath.pData, rName.pData, nMask1, nMask2, NULL); - } - - /** Insert a file entry as 'hard link' to another file entry. - @see store_link() - */ - inline storeError link ( - rtl::OUString const & rSrcPath, rtl::OUString const & rSrcName, - rtl::OUString const & rDstPath, rtl::OUString const & rDstName) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_link ( - m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData); - } - - /** Insert a file entry as 'symbolic link' to another file entry. - @see store_symlink() - */ - inline storeError symlink ( - rtl::OUString const & rSrcPath, rtl::OUString const & rSrcName, - rtl::OUString const & rDstPath, rtl::OUString const & rDstName) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_symlink (m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData); - } - - /** Rename a file entry. - @see store_rename() - */ - inline storeError rename ( - rtl::OUString const & rSrcPath, rtl::OUString const & rSrcName, - rtl::OUString const & rDstPath, rtl::OUString const & rDstName) - { - if (!m_hImpl) - return store_E_InvalidHandle; - - return store_rename (m_hImpl, rSrcPath.pData, rSrcName.pData, rDstPath.pData, rDstName.pData); - } - /** Remove a file entry. @see store_remove() */ diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx index ccb489e0ce64..55399e340a6f 100644 --- a/include/svtools/grfmgr.hxx +++ b/include/svtools/grfmgr.hxx @@ -162,9 +162,6 @@ public: return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 || mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert ); } - - friend SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr ); - friend SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr ); }; class SVT_DLLPUBLIC GraphicObject : public SvDataCopyStream diff --git a/include/tools/errcode.hxx b/include/tools/errcode.hxx index 0df5e305b265..5a8f57af462b 100644 --- a/include/tools/errcode.hxx +++ b/include/tools/errcode.hxx @@ -81,7 +81,6 @@ Warning || || | #ifdef __RSC -#define ERRCODE_TOERRID(x) (x & ~ERRCODE_DYNAMIC_MASK) #define ERRCODE_TOERROR(x) \ ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK)) @@ -89,11 +88,6 @@ Warning || || | typedef sal_uInt32 ErrCode; -inline sal_uInt32 ERRCODE_TOERRID( ErrCode x ) -{ - return x & ~ERRCODE_DYNAMIC_MASK; -} - inline sal_uInt32 ERRCODE_TOERROR( ErrCode x ) { return ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK)); diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx index 56aa05645a6b..402a0c9e0635 100644 --- a/include/tools/pstm.hxx +++ b/include/tools/pstm.hxx @@ -159,7 +159,6 @@ public: virtual ~SvPersistStream(); void SetStream( SvStream * pStream ); - SvStream * GetStream() const { return pStm; } SvPersistBase * GetObject( sal_uIntPtr nIdx ) const; sal_uIntPtr GetIndex( SvPersistBase * ) const; @@ -175,9 +174,6 @@ public: SvPersistStream& ReadPointer( SvPersistBase * & rpObj ); TOOLS_DLLPUBLIC friend SvPersistStream& WriteSvPersistBase(SvPersistStream &, SvPersistBase *); TOOLS_DLLPUBLIC friend SvPersistStream& operator >> (SvPersistStream &, SvPersistBase * &); - - // Objects maintain their IDs while storing and loading to/from stream - friend SvStream& operator >> ( SvStream &, SvPersistStream & ); }; #endif diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx index b98fd79dd211..93b0c564c594 100644 --- a/include/tools/ref.hxx +++ b/include/tools/ref.hxx @@ -130,14 +130,6 @@ public: p->AddFirstRef(); } - inline void insert(const SvRefMemberList& rOther) - { - for( typename base_t::const_iterator it = rOther.begin(); it != rOther.end(); ++it ) - { - push_back(*it); - } - } - inline T pop_back() { T p = base_t::back(); diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 46296bb069c1..2ac01dbbfe41 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -153,8 +153,6 @@ public: virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount, sal_Size * pWritten) = 0; - - virtual void Terminate() = 0; }; @@ -178,8 +176,6 @@ public: virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount, sal_Size * pWritten) override; - - virtual void Terminate() override { m_bTerminated = true; } }; diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index 27de75f26515..66a65f59d8c1 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -42,7 +42,6 @@ public: sal_uIntPtr Insert( void* p ); // insert value with key, replacing existing entry if necessary - void Insert( sal_uIntPtr aIndex, void* p ); void* Remove( sal_uIntPtr aIndex ); void* Get( sal_uIntPtr aIndex ) const; @@ -59,10 +58,8 @@ public: UniqueIndex<T>( sal_uIntPtr _nStartIndex = 0 ) : UniqueIndexImpl(_nStartIndex) {} sal_uIntPtr Insert(T* p) { return UniqueIndexImpl::Insert(p); } - void Insert(sal_uIntPtr aIdx, T* p) { return UniqueIndexImpl::Insert(aIdx, p); } T* Get(sal_uIntPtr idx) const { return static_cast<T*>( UniqueIndexImpl::Get(idx) ); } T* Remove(sal_uIntPtr idx) { return static_cast<T*>( UniqueIndexImpl::Remove(idx) ); } - sal_uIntPtr Count() const { return UniqueIndexImpl::size(); } sal_uIntPtr GetIndexOf(T* p) const { return UniqueIndexImpl::GetIndexOf(p); } using UniqueIndexImpl::FirstIndex; diff --git a/include/unotools/sharedunocomponent.hxx b/include/unotools/sharedunocomponent.hxx index 9a293dee9759..0d7921b75a1f 100644 --- a/include/unotools/sharedunocomponent.hxx +++ b/include/unotools/sharedunocomponent.hxx @@ -194,11 +194,8 @@ namespace utl inline bool set( const css::uno::BaseReference& _rRef, css::uno::UnoReference_Query _query ); - inline void set( const css::uno::XInterface* _pInterface, css::uno::UnoReference_QueryThrow _queryThrow ); inline void set( const css::uno::BaseReference & _rRef, css::uno::UnoReference_QueryThrow _queryThrow ); - inline void set( const css::uno::Any& _rAny, css::uno::UnoReference_QueryThrow _queryThrow ); - inline void set( const INTERFACE* _pInterface, css::uno::UnoReference_SetThrow _setThrow ); inline void set( const css::uno::Reference< INTERFACE >& _rRef, css::uno::UnoReference_SetThrow _setThrow ); inline void set( const SharedUNOComponent& _rComp, css::uno::UnoReference_SetThrow _setThrow ); @@ -241,11 +238,6 @@ namespace utl } // comparison operators - template < class INTERFACE, class COMPONENT > - bool operator==( const css::uno::Reference< INTERFACE >& _rLHS, const SharedUNOComponent< INTERFACE, COMPONENT >& _rRHS ) - { - return _rLHS == _rRHS.getTyped(); - } template < class INTERFACE, class COMPONENT > bool operator==( const SharedUNOComponent< INTERFACE, COMPONENT >& _rLHS, const css::uno::Reference< INTERFACE >& _rRHS ) @@ -253,13 +245,6 @@ namespace utl return _rLHS.getTyped() == _rRHS; } - // conversion to Any - template < class INTERFACE, class COMPONENT > - inline void SAL_CALL operator <<= ( css::uno::Any & rAny, const SharedUNOComponent< INTERFACE, COMPONENT >& value ) - { - rAny <<= value.getTyped(); - } - template < class INTERFACE, class COMPONENT > inline css::uno::Any SAL_CALL makeAny( const SharedUNOComponent< INTERFACE, COMPONENT >& value ) { @@ -267,30 +252,12 @@ namespace utl } template < class INTERFACE, class COMPONENT > - void SharedUNOComponent< INTERFACE, COMPONENT >::set( const css::uno::XInterface* _pInterface, css::uno::UnoReference_QueryThrow _queryThrow ) - { - reset( css::uno::Reference< INTERFACE >( _pInterface, _queryThrow ), TakeOwnership ); - } - - template < class INTERFACE, class COMPONENT > void SharedUNOComponent< INTERFACE, COMPONENT >::set( const css::uno::BaseReference & _rRef, css::uno::UnoReference_QueryThrow _queryThrow ) { reset( css::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership ); } template < class INTERFACE, class COMPONENT > - void SharedUNOComponent< INTERFACE, COMPONENT >::set( const css::uno::Any& _rAny, css::uno::UnoReference_QueryThrow _queryThrow ) - { - reset( css::uno::Reference< INTERFACE >( _rAny, _queryThrow ), TakeOwnership ); - } - - template < class INTERFACE, class COMPONENT > - void SharedUNOComponent< INTERFACE, COMPONENT >::set( const INTERFACE* _pInterface, css::uno::UnoReference_SetThrow _setThrow ) - { - reset( css::uno::Reference< INTERFACE >( _pInterface, _setThrow ), TakeOwnership ); - } - - template < class INTERFACE, class COMPONENT > void SharedUNOComponent< INTERFACE, COMPONENT >::set( const css::uno::Reference< INTERFACE >& _rRef, css::uno::UnoReference_SetThrow _setThrow ) { reset( css::uno::Reference< INTERFACE >( _rRef, _setThrow ), TakeOwnership ); diff --git a/include/vbahelper/vbareturntypes.hxx b/include/vbahelper/vbareturntypes.hxx index 151ca5547d8a..cc759c32742b 100644 --- a/include/vbahelper/vbareturntypes.hxx +++ b/include/vbahelper/vbareturntypes.hxx @@ -39,9 +39,9 @@ namespace ooo T1 mnValue; public: DefaultReturnHelper( const T1& nValue ) : mnValue( nValue ) {} - virtual void SAL_CALL setValue( T1 nValue ) throw (css::uno::RuntimeException) { mnValue = nValue; } - virtual T1 SAL_CALL getValue() throw (css::uno::RuntimeException) { return mnValue; } - OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return OUString("Value"); } + virtual void SAL_CALL setValue( T1 nValue ) throw (css::uno::RuntimeException) SAL_OVERRIDE { mnValue = nValue; } + virtual T1 SAL_CALL getValue() throw (css::uno::RuntimeException) SAL_OVERRIDE { return mnValue; } + OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) SAL_OVERRIDE { return OUString("Value"); } }; typedef DefaultReturnHelper< sal_Int32, ov::msforms::XReturnInteger > ReturnInteger_BASE; diff --git a/include/vcl/BitmapFilterStackBlur.hxx b/include/vcl/BitmapFilterStackBlur.hxx index 68fa107957e4..5b2b002db534 100644 --- a/include/vcl/BitmapFilterStackBlur.hxx +++ b/include/vcl/BitmapFilterStackBlur.hxx @@ -24,9 +24,7 @@ public: BitmapFilterStackBlur(sal_Int32 nRadius, bool bExtend = true); virtual ~BitmapFilterStackBlur(); - virtual bool filter(Bitmap& rBitmap) override; - - bool filter(BitmapEx& rBitmap); + bool filter(Bitmap& rBitmap) override; }; #endif // INCLUDED_VCL_BITMAPFILTERSTACKBLUR_HXX diff --git a/include/vcl/bmpacc.hxx b/include/vcl/bmpacc.hxx index e832528c9f2b..b877c227ea2a 100644 --- a/include/vcl/bmpacc.hxx +++ b/include/vcl/bmpacc.hxx @@ -138,7 +138,6 @@ protected: public: - SAL_DLLPRIVATE void ImplZeroInitUnusedBits(); SAL_DLLPRIVATE BitmapBuffer* ImplGetBitmapBuffer() const { return mpBuffer; diff --git a/include/vcl/cvtgrf.hxx b/include/vcl/cvtgrf.hxx index b869a61c181a..f9f427684f8b 100644 --- a/include/vcl/cvtgrf.hxx +++ b/include/vcl/cvtgrf.hxx @@ -36,7 +36,6 @@ class VCL_DLLPUBLIC GraphicConverter private: Link<ConvertData&,bool> maFilterHdl; - ConvertData* mpConvertData; public: @@ -46,8 +45,6 @@ public: static sal_uLong Import( SvStream& rIStm, Graphic& rGraphic, ConvertDataFormat nFormat = ConvertDataFormat::Unknown ); static sal_uLong Export( SvStream& rOStm, const Graphic& rGraphic, ConvertDataFormat nFormat ); - ConvertData* GetConvertData() { return mpConvertData; } - void SetFilterHdl( const Link<ConvertData&,bool>& rLink ) { maFilterHdl = rLink; } const Link<ConvertData&,bool>& GetFilterHdl() const { return maFilterHdl; } }; diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index fe4e0e0edefe..df5bd78051bf 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -212,9 +212,6 @@ public: /** @return bits/pixel or 0 **/ sal_uInt16 GetBitsPerPixel() const { return nBitsPerPixel; } - /** return number of planes or 0 */ - sal_uInt16 GetPlanes() const { return nPlanes; } - /** @return filter number that is needed by the GraphFilter to read this format */ static OUString GetImportFormatShortName( GraphicFileFormat nFormat ); }; @@ -253,18 +250,16 @@ public: GraphicFilter( bool bUseConfig = true ); ~GraphicFilter(); - void SetFilterPath( const OUString& rFilterPath ) { aFilterPath = rFilterPath; }; - sal_uInt16 GetImportFormatCount(); sal_uInt16 GetImportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetImportFormatNumberForMediaType( const OUString& rMediaType ); sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName ); sal_uInt16 GetImportFormatNumberForTypeName( const OUString& rType ); OUString GetImportFormatName( sal_uInt16 nFormat ); OUString GetImportFormatTypeName( sal_uInt16 nFormat ); +#ifdef WNT OUString GetImportFormatMediaType( sal_uInt16 nFormat ); +#endif OUString GetImportFormatShortName( sal_uInt16 nFormat ); - static OUString GetImportOSFileType( sal_uInt16 nFormat ); OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 ); sal_uInt16 GetExportFormatCount(); @@ -274,10 +269,8 @@ public: OUString GetExportInternalFilterName( sal_uInt16 nFormat ); sal_uInt16 GetExportFormatNumberForTypeName( const OUString& rType ); OUString GetExportFormatName( sal_uInt16 nFormat ); - OUString GetExportFormatTypeName( sal_uInt16 nFormat ); OUString GetExportFormatMediaType( sal_uInt16 nFormat ); OUString GetExportFormatShortName( sal_uInt16 nFormat ); - static OUString GetExportOSFileType( sal_uInt16 nFormat ); OUString GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 ); bool IsExportPixelFormat( sal_uInt16 nFormat ); @@ -313,8 +306,6 @@ public: css::uno::Sequence< css::beans::PropertyValue >* pFilterData, WMF_EXTERNALHEADER *pExtHeader = NULL ); - void Abort() { bAbort = true; } - const FilterErrorEx& GetLastError() const { return *pErrorEx;} void ResetLastError(); diff --git a/include/vcl/threadex.hxx b/include/vcl/threadex.hxx index 2ea99d4462e1..c2aee506758a 100644 --- a/include/vcl/threadex.hxx +++ b/include/vcl/threadex.hxx @@ -46,11 +46,6 @@ namespace vcl virtual long doIt() = 0; long execute() { return impl_execute( NULL ); } - // caution: timeout for getting the solar mutex, not for ending - // the operation of doIt(). If doIt actually gets called within - // the specified timeout, execute will only return after - // doIt() completed - long execute( const TimeValue& _rTimeout ) { return impl_execute( &_rTimeout ); } private: long impl_execute( const TimeValue* _pTimeout ); @@ -101,16 +96,6 @@ private: template <typename FuncT> class GenericSolarThreadExecutor<FuncT, void> : public SolarThreadExecutor { -public: - static void exec( FuncT const& func ) - { - typedef GenericSolarThreadExecutor<FuncT, void> ExecutorT; - ::std::unique_ptr<ExecutorT> const pExecutor( new ExecutorT(func) ); - pExecutor->execute(); - if (pExecutor->m_exc.hasValue()) - ::cppu::throwException( pExecutor->m_exc ); - } - private: explicit GenericSolarThreadExecutor( FuncT const& func ) : m_exc(), m_func(func) {} @@ -163,35 +148,6 @@ private: } // namespace detail -/** Makes a copy back reference wrapper to be used for inout parameters. - Only use for syncExecute(), the returned wrapper relies on its - implementation, i.e. the function object is stored in free store. - Type T needs to be copy constructable assignable. - - @see syncExecute() - @param r reference to a stack variable - @return reference wrapper -*/ -template <typename T> -inline detail::copy_back_wrapper<T> inout_by_ref( T & r ) -{ - return detail::copy_back_wrapper<T>(&r); -} - -/** Makes a copy back ptr wrapper to be used for inout parameters. - Only use for syncExecute(), the returned wrapper relies on its - implementation, i.e. the function object is stored in free store. - Type T needs to be copy constructable assignable. - - @see syncExecute() - @param p pointer to a stack variable - @return ptr wrapper -*/ -template <typename T> -inline detail::copy_back_wrapper<T> inout_by_ptr( T * p ) -{ - return detail::copy_back_wrapper<T>(p); -} /** This function will execute the passed functor synchronously in the solar thread, thus the calling thread will (eventually) be blocked until @@ -230,12 +186,6 @@ inline detail::copy_back_wrapper<T> inout_by_ptr( T * p ) @param func functor object to be executed in solar thread @return return value of functor */ -template <typename ResultT, typename FuncT> -inline ResultT syncExecute( FuncT const& func ) -{ - return detail::GenericSolarThreadExecutor<FuncT, ResultT>::exec(func); -} - template <typename FuncT> inline typename FuncT::result_type syncExecute( FuncT const& func ) { diff --git a/jvmaccess/source/classpath.cxx b/jvmaccess/source/classpath.cxx index 9fdc0fca78ad..abde60f81478 100644 --- a/jvmaccess/source/classpath.cxx +++ b/jvmaccess/source/classpath.cxx @@ -101,44 +101,4 @@ jobjectArray jvmaccess::ClassPath::translateToUrls( return result; } -jclass jvmaccess::ClassPath::loadClass( - css::uno::Reference< css::uno::XComponentContext > const & context, - JNIEnv * environment, OUString const & classPath, OUString const & name) -{ - assert(context.is()); - assert(environment != 0); - jclass classLoader(environment->FindClass("java/net/URLClassLoader")); - if (classLoader == 0) { - return 0; - } - jmethodID ctorLoader( - environment->GetMethodID(classLoader, "<init>", "([Ljava/net/URL;)V")); - if (ctorLoader == 0) { - return 0; - } - jvalue arg; - arg.l = translateToUrls(context, environment, classPath); - if (arg.l == 0) { - return 0; - } - jobject cl = environment->NewObjectA(classLoader, ctorLoader, &arg); - if (cl == 0) { - return 0; - } - jmethodID methLoadClass( - environment->GetMethodID( - classLoader, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;")); - if (methLoadClass == 0) { - return 0; - } - arg.l = environment->NewString( - static_cast< jchar const * >(name.getStr()), - static_cast< jsize >(name.getLength())); - if (arg.l == 0) { - return 0; - } - return static_cast<jclass>( - environment->CallObjectMethodA(cl, methLoadClass, &arg)); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 02730683a0b4..8096841f6e18 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -1090,27 +1090,6 @@ void MergedSettings::getVmParametersArray( *size = m_vmParams.size(); } -void MergedSettings::getJRELocations( - rtl_uString *** parLocations, sal_Int32 * size) const -{ - osl::MutexGuard guard(FwkMutex::get()); - assert(parLocations != NULL && size != NULL); - - *parLocations = static_cast<rtl_uString **>( - rtl_allocateMemory(sizeof(rtl_uString*) * m_JRELocations.size())); - if (*parLocations == NULL) - return; - - int j=0; - typedef std::vector<OUString>::const_iterator it; - for (it i = m_JRELocations.begin(); i != m_JRELocations.end(); - ++i, ++j) - { - (*parLocations)[j] = i->pData; - rtl_uString_acquire(i->pData); - } - *size = m_JRELocations.size(); -} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jvmfwk/source/elements.hxx b/jvmfwk/source/elements.hxx index d1a741945fa6..7d457914ca29 100644 --- a/jvmfwk/source/elements.hxx +++ b/jvmfwk/source/elements.hxx @@ -314,11 +314,6 @@ public: */ void getVmParametersArray(rtl_uString *** parParameters, sal_Int32 * size) const; - /** returns an array. - Caller must free the strings and the array. - */ - void getJRELocations(rtl_uString *** parLocations, sal_Int32 * size) const; - const ::std::vector< OUString> & getJRELocations() const { return m_JRELocations;} }; diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 5d18738a6ddc..1bd033fe13e7 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -1005,32 +1005,6 @@ javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation) } -javaFrameworkError SAL_CALL jfw_getJRELocations( - rtl_uString *** parLocations, sal_Int32 *pLen) -{ - javaFrameworkError errcode = JFW_E_NONE; - try - { - osl::MutexGuard guard(jfw::FwkMutex::get()); - if (jfw::getMode() == jfw::JFW_MODE_DIRECT) - return JFW_E_DIRECT_MODE; - - if (parLocations == NULL || pLen == NULL) - return JFW_E_INVALID_ARG; - const jfw::MergedSettings settings; - settings.getJRELocations(parLocations, pLen); - } - catch (const jfw::FrameworkException& e) - { - errcode = e.errorCode; - fprintf(stderr, "%s\n", e.message.getStr()); - OSL_FAIL(e.message.getStr()); - } - - return errcode; -} - - javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist) { //get the function jfw_plugin_existJRE diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx index 249a319a8b47..c5d8190989cf 100644 --- a/pyuno/source/module/pyuno_impl.hxx +++ b/pyuno/source/module/pyuno_impl.hxx @@ -260,17 +260,9 @@ PyRef ustring2PyString( const OUString & source ); OUString pyString2ustring( PyObject *str ); -PyRef AnyToPyObject (const css::uno::Any & a, const Runtime &r ) - throw ( css::uno::RuntimeException ); - -css::uno::Any PyObjectToAny (PyObject* o) - throw ( css::uno::RuntimeException ); - void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime ) throw ( css::reflection::InvocationTargetException ); -css::uno::TypeClass StringToTypeClass (char* string); - PyRef PyUNO_callable_new ( const css::uno::Reference<css::script::XInvocation2> &xInv, const OUString &methodName, @@ -283,7 +275,6 @@ PyObject *PyUNO_ByteSequence_new( const css::uno::Sequence< sal_Int8 > &, const PyRef getTypeClass( const Runtime &); PyRef getEnumClass( const Runtime &); -PyRef getBoolClass( const Runtime &); PyRef getCharClass( const Runtime &); PyRef getByteSequenceClass( const Runtime & ); PyRef getPyUnoClass(); @@ -307,8 +298,6 @@ PyRef getObjectFromUnoModule( const Runtime &runtime, const char * object ) bool isInterfaceClass( const Runtime &, PyObject *obj ); bool isInstanceOfStructOrException( PyObject *obj); -css::uno::Sequence<css::uno::Type> implementsInterfaces( - const Runtime & runtime, PyObject *obj ); struct RuntimeCargo { diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx index 14b2aa92535c..2a3fbae1001d 100644 --- a/sc/inc/bigrange.hxx +++ b/sc/inc/bigrange.hxx @@ -219,20 +219,6 @@ inline bool ScBigRange::Intersects( const ScBigRange& r ) const ); } -inline SvStream& WriteScBigRange ( SvStream& rStream, const ScBigRange& rRange ) -{ - WriteScBigAddress( rStream, rRange.aStart ); - WriteScBigAddress( rStream, rRange.aEnd ); - return rStream; -} - -inline SvStream& ReadScBigRange( SvStream& rStream, ScBigRange& rRange ) -{ - ReadScBigAddress( rStream, rRange.aStart ); - ReadScBigAddress( rStream, rRange.aEnd ); - return rStream; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 724b1e20f322..3171af631898 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -80,7 +80,6 @@ public: void setCode( ScTokenArray* pCode ); void compileCode( ScDocument& rDoc, const ScAddress& rPos, formula::FormulaGrammar::Grammar eGram ); - void compileOpenCLKernel(); sc::FormulaGroupAreaListener* getAreaListener( ScFormulaCell** ppTopCell, const ScRange& rRange, bool bStartFixed, bool bEndFixed ); diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index 6a5c50948f02..384ea0a24d3b 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -141,7 +141,6 @@ public: static void getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId); #endif virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) = 0; - virtual CompiledFormula* createCompiledFormula( ScFormulaCellGroup& rGroup, ScTokenArray& rCode ) = 0; virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode) = 0; }; @@ -153,7 +152,6 @@ public: virtual ~FormulaGroupInterpreterSoftware() {} virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) override; - virtual CompiledFormula* createCompiledFormula( ScFormulaCellGroup& rGroup, ScTokenArray& rCode ) override; virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode) override; }; diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 07cd700e590c..48a6e7cb7bef 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -597,17 +597,6 @@ void ScFormulaCellGroup::compileCode( } } -void ScFormulaCellGroup::compileOpenCLKernel() -{ - if (meCalcState == sc::GroupCalcDisabled) - return; - - mpCompiledFormula = - sc::FormulaGroupInterpreter::getStatic()->createCompiledFormula(*this, *mpCode); - - meKernelState = sc::OpenCLKernelBinaryCreated; -} - sc::FormulaGroupAreaListener* ScFormulaCellGroup::getAreaListener( ScFormulaCell** ppTopCell, const ScRange& rRange, bool bStartFixed, bool bEndFixed ) { diff --git a/sc/source/core/inc/formulagroupcl.hxx b/sc/source/core/inc/formulagroupcl.hxx index b65ff3067548..51971227e746 100644 --- a/sc/source/core/inc/formulagroupcl.hxx +++ b/sc/source/core/inc/formulagroupcl.hxx @@ -21,8 +21,6 @@ public: virtual ~FormulaGroupInterpreterOpenCL(); virtual ScMatrixRef inverseMatrix( const ScMatrix& rMat ) override; - virtual CompiledFormula* createCompiledFormula( - ScFormulaCellGroup& rGroup, ScTokenArray& rCode ) override; virtual bool interpret( ScDocument& rDoc, const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode ) override; }; diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index ab4fa023c51f..7d69521dda9b 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -4096,12 +4096,6 @@ DynamicKernel* DynamicKernel::create( const ScCalcConfig& rConfig, ScTokenArray& return pDynamicKernel; } -CompiledFormula* FormulaGroupInterpreterOpenCL::createCompiledFormula( - ScFormulaCellGroup& rGroup, ScTokenArray& rCode ) -{ - return DynamicKernel::create(maCalcConfig, rCode, rGroup.mnLength); -} - namespace { class CLInterpreterResult diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index 64a1b04888a6..1e73276b65dc 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -300,12 +300,6 @@ ScMatrixRef FormulaGroupInterpreterSoftware::inverseMatrix(const ScMatrix& /*rMa return ScMatrixRef(); } -CompiledFormula* FormulaGroupInterpreterSoftware::createCompiledFormula( - ScFormulaCellGroup& /*rGroup*/, ScTokenArray& /*rCode*/ ) -{ - return NULL; -} - bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode) diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx index cca2c0aeaeac..692b6d0bbf43 100644 --- a/sc/source/filter/inc/xerecord.hxx +++ b/sc/source/filter/inc/xerecord.hxx @@ -326,9 +326,6 @@ public: inline void ReplaceRecord( RecordRefType xRec, size_t nPos ) { RemoveRecord( nPos ); InsertRecord( xRec, nPos ); } - /** Inserts a newly created record at the specified position into the list. */ - inline void InsertNewRecord( RecType* pRec, size_t nPos ) - { if( pRec ) InsertRecord( RecordRefType( pRec ), nPos ); } /** Appends a newly created record to the list. */ inline void AppendNewRecord( RecType* pRec ) { if( pRec ) AppendRecord( RecordRefType( pRec ) ); } diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index e5e88722225b..888edd6e3af9 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -44,15 +44,6 @@ using namespace ::com::sun::star::sheet::ReferenceFlags; using namespace ::com::sun::star::table; using namespace ::com::sun::star::uno; -namespace { - -sal_uInt16 lclReadFmlaSize( BiffInputStream& rStrm, BiffType eBiff, const sal_uInt16* pnFmlaSize ) -{ - return pnFmlaSize ? *pnFmlaSize : ((eBiff == BIFF2) ? rStrm.readuInt8() : rStrm.readuInt16()); -} - -} // namespace - // formula finalizer ========================================================== FormulaFinalizer::FormulaFinalizer( const OpCodeProvider& rOpCodeProv ) : @@ -441,12 +432,6 @@ public: FormulaType eType, SequenceInputStream& rStrm ); - /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */ - virtual ApiTokenSequence importBiffFormula( - const CellAddress& rBaseAddress, - FormulaType eType, - BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ); - /** Tries to resolve the passed ref-id to an OLE target URL. */ OUString resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const; @@ -600,12 +585,6 @@ ApiTokenSequence FormulaParserImpl::importBiff12Formula( const CellAddress&, For return ApiTokenSequence(); } -ApiTokenSequence FormulaParserImpl::importBiffFormula( const CellAddress&, FormulaType, BiffInputStream&, const sal_uInt16* ) -{ - OSL_FAIL( "FormulaParserImpl::importBiffFormula - not implemented" ); - return ApiTokenSequence(); -} - OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const { const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, bUseRefSheets ).get(); @@ -1842,11 +1821,6 @@ class BiffFormulaParserImpl : public FormulaParserImpl public: explicit BiffFormulaParserImpl( const FormulaParser& rParent ); - virtual ApiTokenSequence importBiffFormula( - const CellAddress& rBaseAddr, - FormulaType eType, - BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ) override; - private: // import token contents and create API formula token --------------------- @@ -1854,7 +1828,6 @@ private: bool importRefTokenNotAvailable( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); bool importStrToken2( BiffInputStream& rStrm ); bool importStrToken8( BiffInputStream& rStrm ); - bool importAttrToken( BiffInputStream& rStrm ); bool importSpaceToken3( BiffInputStream& rStrm ); bool importSpaceToken4( BiffInputStream& rStrm ); bool importSheetToken2( BiffInputStream& rStrm ); @@ -1862,7 +1835,6 @@ private: bool importEndSheetToken2( BiffInputStream& rStrm ); bool importEndSheetToken3( BiffInputStream& rStrm ); bool importNlrToken( BiffInputStream& rStrm ); - bool importArrayToken( BiffInputStream& rStrm ); bool importRefToken2( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); bool importRefToken8( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); bool importAreaToken2( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); @@ -1871,17 +1843,12 @@ private: bool importRef3dToken8( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); bool importArea3dToken5( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); bool importArea3dToken8( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ); - bool importMemAreaToken( BiffInputStream& rStrm, bool bAddData ); - bool importMemFuncToken( BiffInputStream& rStrm ); - bool importNameToken( BiffInputStream& rStrm ); bool importNameXToken( BiffInputStream& rStrm ); bool importFuncToken2( BiffInputStream& rStrm ); bool importFuncToken4( BiffInputStream& rStrm ); bool importFuncVarToken2( BiffInputStream& rStrm ); bool importFuncVarToken4( BiffInputStream& rStrm ); bool importFuncCEToken( BiffInputStream& rStrm ); - bool importExpToken( BiffInputStream& rStrm ); - bool importTblToken( BiffInputStream& rStrm ); bool importNlrAddrToken( BiffInputStream& rStrm, bool bRow ); bool importNlrRangeToken( BiffInputStream& rStrm ); @@ -1895,7 +1862,6 @@ private: LinkSheetRange readSheetRange8( BiffInputStream& rStrm ); void swapStreamPosition( BiffInputStream& rStrm ); - void skipMemAreaAddData( BiffInputStream& rStrm ); bool readNlrSAddrAddData( BiffNlr& orNlr, BiffInputStream& rStrm, bool bRow ); bool readNlrSRangeAddData( BiffNlr& orNlr, bool& orbIsRow, BiffInputStream& rStrm ); @@ -2075,110 +2041,6 @@ BiffFormulaParserImpl::BiffFormulaParserImpl( const FormulaParser& rParent ) : } } -ApiTokenSequence BiffFormulaParserImpl::importBiffFormula( const CellAddress& rBaseAddr, - FormulaType eType, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ) -{ - initializeImport( rBaseAddr, eType ); - mnCurrRefId = 0; - - sal_uInt16 nFmlaSize = lclReadFmlaSize( rStrm, getBiff(), pnFmlaSize ); - sal_Int64 nEndPos = mnAddDataPos = rStrm.tell() + nFmlaSize; - - bool bOk = true; - while( bOk && !rStrm.isEof() && (rStrm.tell() < nEndPos) ) - { - sal_uInt8 nTokenId; - rStrm >> nTokenId; - sal_uInt8 nTokenClass = nTokenId & BIFF_TOKCLASS_MASK; - sal_uInt8 nBaseId = nTokenId & BIFF_TOKID_MASK; - - bOk = !getFlag( nTokenId, BIFF_TOKFLAG_INVALID ); - if( bOk ) - { - if( nTokenClass == BIFF_TOKCLASS_NONE ) - { - // base tokens - switch( nBaseId ) - { - case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break; - case BIFF_TOKID_TBL: bOk = importTblToken( rStrm ); break; - case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break; - case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break; - case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break; - case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break; - case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break; - case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break; - case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break; - case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break; - case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break; - case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break; - case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break; - case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break; - case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break; - case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break; - case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break; - case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break; - case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break; - case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break; - case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break; - case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break; - case BIFF_TOKID_STR: bOk = (this->*mpImportStrToken)( rStrm ); break; - case BIFF_TOKID_NLR: bOk = (this->*mpImportNlrToken)( rStrm ); break; - case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break; - case BIFF_TOKID_SHEET: bOk = (this->*mpImportSheetToken)( rStrm ); break; - case BIFF_TOKID_ENDSHEET: bOk = (this->*mpImportEndSheetToken)( rStrm ); break; - case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break; - case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break; - case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break; - default: bOk = false; - } - } - else - { - // classified tokens - switch( nBaseId ) - { - case BIFF_TOKID_ARRAY: bOk = importArrayToken( rStrm ); break; - case BIFF_TOKID_FUNC: bOk = (this->*mpImportFuncToken)( rStrm ); break; - case BIFF_TOKID_FUNCVAR: bOk = (this->*mpImportFuncVarToken)( rStrm ); break; - case BIFF_TOKID_NAME: bOk = importNameToken( rStrm ); break; - case BIFF_TOKID_REF: bOk = (this->*mpImportRefToken)( rStrm, false, false ); break; - case BIFF_TOKID_AREA: bOk = (this->*mpImportAreaToken)( rStrm, false, false ); break; - case BIFF_TOKID_MEMAREA: bOk = importMemAreaToken( rStrm, true ); break; - case BIFF_TOKID_MEMERR: bOk = importMemAreaToken( rStrm, false ); break; - case BIFF_TOKID_MEMNOMEM: bOk = importMemAreaToken( rStrm, false ); break; - case BIFF_TOKID_MEMFUNC: bOk = importMemFuncToken( rStrm ); break; - case BIFF_TOKID_REFERR: bOk = (this->*mpImportRefToken)( rStrm, true, false ); break; - case BIFF_TOKID_AREAERR: bOk = (this->*mpImportAreaToken)( rStrm, true, false ); break; - case BIFF_TOKID_REFN: bOk = (this->*mpImportRefToken)( rStrm, false, true ); break; - case BIFF_TOKID_AREAN: bOk = (this->*mpImportAreaToken)( rStrm, false, true ); break; - case BIFF_TOKID_MEMAREAN: bOk = importMemFuncToken( rStrm ); break; - case BIFF_TOKID_MEMNOMEMN: bOk = importMemFuncToken( rStrm ); break; - case BIFF_TOKID_FUNCCE: bOk = (this->*mpImportFuncCEToken)( rStrm ); break; - case BIFF_TOKID_NAMEX: bOk = (this->*mpImportNameXToken)( rStrm ); break; - case BIFF_TOKID_REF3D: bOk = (this->*mpImportRef3dToken)( rStrm, false, mbRelativeAsOffset ); break; - case BIFF_TOKID_AREA3D: bOk = (this->*mpImportArea3dToken)( rStrm, false, mbRelativeAsOffset ); break; - case BIFF_TOKID_REFERR3D: bOk = (this->*mpImportRef3dToken)( rStrm, true, mbRelativeAsOffset ); break; - case BIFF_TOKID_AREAERR3D: bOk = (this->*mpImportArea3dToken)( rStrm, true, mbRelativeAsOffset ); break; - default: bOk = false; - } - } - } - } - - // build and finalize the token sequence - ApiTokenSequence aFinalTokens; - if( bOk && (rStrm.tell() == nEndPos) ) - aFinalTokens = finalizeImport(); - - // seek behind additional token data of tArray, tMemArea, tNlr tokens - rStrm.seek( mnAddDataPos ); - - // return the final token sequence - return aFinalTokens; -} - // import token contents and create API formula token ------------------------- bool BiffFormulaParserImpl::importTokenNotAvailable( BiffInputStream& ) @@ -2204,37 +2066,6 @@ bool BiffFormulaParserImpl::importStrToken8( BiffInputStream& rStrm ) return pushValueOperand( rStrm.readUniStringBody( rStrm.readuInt8(), mbAllowNulChars ) ); } -bool BiffFormulaParserImpl::importAttrToken( BiffInputStream& rStrm ) -{ - bool bOk = true; - sal_uInt8 nType; - rStrm >> nType; - switch( nType ) - { - case 0: // sometimes, tAttrSkip tokens miss the type flag - case BIFF_TOK_ATTR_VOLATILE: - case BIFF_TOK_ATTR_IF: - case BIFF_TOK_ATTR_SKIP: - case BIFF_TOK_ATTR_ASSIGN: - rStrm.skip( mnAttrDataSize ); - break; - case BIFF_TOK_ATTR_CHOOSE: - rStrm.skip( mnAttrDataSize * (1 + ((getBiff() == BIFF2) ? rStrm.readuInt8() : rStrm.readuInt16())) ); - break; - case BIFF_TOK_ATTR_SUM: - rStrm.skip( mnAttrDataSize ); - bOk = pushBiffFunction( BIFF_FUNC_SUM, 1 ); - break; - case BIFF_TOK_ATTR_SPACE: - case BIFF_TOK_ATTR_SPACE_VOLATILE: - bOk = (this->*mpImportSpaceToken)( rStrm ); - break; - default: - bOk = false; - } - return bOk; -} - bool BiffFormulaParserImpl::importSpaceToken3( BiffInputStream& rStrm ) { rStrm.skip( 2 ); @@ -2322,68 +2153,6 @@ bool BiffFormulaParserImpl::importNlrToken( BiffInputStream& rStrm ) return bOk; } -bool BiffFormulaParserImpl::importArrayToken( BiffInputStream& rStrm ) -{ - rStrm.skip( mnArraySize ); - - // start token array with opening brace and leading spaces - pushOperand( OPCODE_ARRAY_OPEN ); - size_t nOpSize = popOperandSize(); - size_t nOldArraySize = getFormulaSize(); - bool bBiff8 = getBiff() == BIFF8; - - // read array size - swapStreamPosition( rStrm ); - sal_uInt16 nCols = rStrm.readuInt8(); - sal_uInt16 nRows = rStrm.readuInt16(); - if( bBiff8 ) { ++nCols; ++nRows; } else if( nCols == 0 ) nCols = 256; - OSL_ENSURE( (nCols > 0) && (nRows > 0), "BiffFormulaParserImpl::importArrayToken - empty array" ); - - // read array values and build token array - for( sal_uInt16 nRow = 0; !rStrm.isEof() && (nRow < nRows); ++nRow ) - { - if( nRow > 0 ) - appendRawToken( OPCODE_ARRAY_ROWSEP ); - for( sal_uInt16 nCol = 0; !rStrm.isEof() && (nCol < nCols); ++nCol ) - { - if( nCol > 0 ) - appendRawToken( OPCODE_ARRAY_COLSEP ); - switch( rStrm.readuInt8() ) - { - case BIFF_DATATYPE_EMPTY: - appendRawToken( OPCODE_PUSH ) <<= OUString(); - rStrm.skip( 8 ); - break; - case BIFF_DATATYPE_DOUBLE: - appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble(); - break; - case BIFF_DATATYPE_STRING: - appendRawToken( OPCODE_PUSH ) <<= bBiff8 ? - rStrm.readUniString( mbAllowNulChars ) : - rStrm.readByteStringUC( false, getTextEncoding(), mbAllowNulChars ); - break; - case BIFF_DATATYPE_BOOL: - appendRawToken( OPCODE_PUSH ) <<= (static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 )); - rStrm.skip( 7 ); - break; - case BIFF_DATATYPE_ERROR: - appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( rStrm.readuInt8() ); - rStrm.skip( 7 ); - break; - default: - OSL_FAIL( "BiffFormulaParserImpl::importArrayToken - unknown data type" ); - appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( BIFF_ERR_NA ); - } - } - } - swapStreamPosition( rStrm ); - - // close token array and set resulting operand size - appendRawToken( OPCODE_ARRAY_CLOSE ); - pushOperandSize( nOpSize + getFormulaSize() - nOldArraySize ); - return true; -} - bool BiffFormulaParserImpl::importRefToken2( BiffInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset ) { BinSingleRef2d aRef; @@ -2444,26 +2213,6 @@ bool BiffFormulaParserImpl::importArea3dToken8( BiffInputStream& rStrm, bool bDe return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset ); } -bool BiffFormulaParserImpl::importMemAreaToken( BiffInputStream& rStrm, bool bAddData ) -{ - rStrm.skip( mnMemAreaSize ); - if( bAddData ) - skipMemAreaAddData( rStrm ); - return true; -} - -bool BiffFormulaParserImpl::importMemFuncToken( BiffInputStream& rStrm ) -{ - rStrm.skip( mnMemFuncSize ); - return true; -} - -bool BiffFormulaParserImpl::importNameToken( BiffInputStream& rStrm ) -{ - sal_uInt16 nNameId = readNameId( rStrm ); - return (mnCurrRefId > 0) ? pushBiffExtName( mnCurrRefId, nNameId ) : pushBiffName( nNameId ); -} - bool BiffFormulaParserImpl::importNameXToken( BiffInputStream& rStrm ) { sal_Int32 nRefId = readRefId( rStrm ); @@ -2509,20 +2258,6 @@ bool BiffFormulaParserImpl::importFuncCEToken( BiffInputStream& rStrm ) return pushBiffFunction( nCmdId, nParamCount ); } -bool BiffFormulaParserImpl::importExpToken( BiffInputStream& rStrm ) -{ - BinAddress aBaseAddr; - aBaseAddr.read( rStrm ); - return pushSpecialTokenOperand( aBaseAddr, false ); -} - -bool BiffFormulaParserImpl::importTblToken( BiffInputStream& rStrm ) -{ - BinAddress aBaseAddr; - aBaseAddr.read( rStrm ); - return pushSpecialTokenOperand( aBaseAddr, true ); -} - bool BiffFormulaParserImpl::importNlrAddrToken( BiffInputStream& rStrm, bool bRow ) { BiffNlr aNlr; @@ -2599,14 +2334,6 @@ void BiffFormulaParserImpl::swapStreamPosition( BiffInputStream& rStrm ) mnAddDataPos = nRecPos; } -void BiffFormulaParserImpl::skipMemAreaAddData( BiffInputStream& rStrm ) -{ - swapStreamPosition( rStrm ); - sal_Int32 nCount = rStrm.readuInt16(); - rStrm.skip( ((getBiff() == BIFF8) ? 8 : 6) * nCount ); - swapStreamPosition( rStrm ); -} - bool BiffFormulaParserImpl::readNlrSAddrAddData( BiffNlr& orNlr, BiffInputStream& rStrm, bool bRow ) { bool bIsRow = false; diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 480499a27fce..7889664ca3f7 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -135,9 +135,6 @@ protected: bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, ScDocument* pDoc ); - void preNotify(const NotifyEvent& rEvent, const bool bBindRef); - void stateChanged(const StateChangedType nStateChange, const bool bBindRef); - public: ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef ); virtual ~ScRefHandler(); diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 78c534264614..630693cd79fe 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -525,18 +525,6 @@ inline ScVSplitPos WhichV( ScSplitPos ePos ) SC_SPLIT_TOP : SC_SPLIT_BOTTOM; } -inline ScSplitPos Which( ScHSplitPos eHPos ) -{ - return (eHPos==SC_SPLIT_LEFT) ? - SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT; -} - -inline ScSplitPos Which( ScVSplitPos eVPos ) -{ - return (eVPos==SC_SPLIT_TOP) ? - SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 385537a20f26..dfce667e6912 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -941,39 +941,6 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* m_aHelper.ToggleCollapsed( pEdit, pButton ); } -void ScRefHandler::preNotify(const NotifyEvent& rNEvt, const bool bBindRef) -{ - if( bBindRef || m_bInRefMode ) - { - MouseNotifyEvent nSwitch=rNEvt.GetType(); - if(nSwitch==MouseNotifyEvent::GETFOCUS) - { - pActiveWin=rNEvt.GetWindow(); - } - } -} - -void ScRefHandler::stateChanged(const StateChangedType nStateChange, const bool bBindRef) -{ - if( !bBindRef && !m_bInRefMode ) return; - - if(nStateChange == StateChangedType::Visible) - { - if(m_rWindow->IsVisible()) - { - ScFormulaReferenceHelper::enableInput( false ); - ScFormulaReferenceHelper::EnableSpreadsheets(); - ScFormulaReferenceHelper::SetDispatcherLock( true ); - aIdle.Start(); - } - else - { - ScFormulaReferenceHelper::enableInput( true ); - ScFormulaReferenceHelper::SetDispatcherLock( false ); /*//! here and in DoClose ?*/ - } - } -} - IMPL_LINK_NOARG_TYPED(ScRefHandler, UpdateFocusHdl, Idle *, void) { if (pActiveWin) diff --git a/sc/source/ui/vba/vbacondition.cxx b/sc/source/ui/vba/vbacondition.cxx index 32ebb1cea1e0..7d73d2702d04 100644 --- a/sc/source/ui/vba/vbacondition.cxx +++ b/sc/source/ui/vba/vbacondition.cxx @@ -105,17 +105,6 @@ ScVbaCondition< Ifc... >::setFormula1( const uno::Any& _aFormula1) throw ( scrip } template< typename... Ifc > -void -ScVbaCondition< Ifc... >::setFormula2( const uno::Any& _aFormula2) throw ( script::BasicErrorException ) -{ - OUString sFormula2; - // #TODO surely this can't be right? - // ( from helperapi/impl/.../calc/ConditionImpl.java - if ( (_aFormula2 >>= sFormula2 )) - mxSheetCondition->setFormula1(sFormula2); -} - -template< typename... Ifc > sal_Int32 ScVbaCondition< Ifc... >::Operator(bool _bIncludeFormulaValue) throw ( script::BasicErrorException ) { diff --git a/sc/source/ui/vba/vbacondition.hxx b/sc/source/ui/vba/vbacondition.hxx index 3c96a5d646af..2dcda6ce2df6 100644 --- a/sc/source/ui/vba/vbacondition.hxx +++ b/sc/source/ui/vba/vbacondition.hxx @@ -35,12 +35,11 @@ public: static css::sheet::ConditionOperator retrieveAPIOperator( const css::uno::Any& _aOperator) throw ( css::script::BasicErrorException ); - virtual OUString SAL_CALL Formula1( ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); - virtual OUString SAL_CALL Formula2( ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); + virtual OUString SAL_CALL Formula1( ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ) SAL_OVERRIDE; + virtual OUString SAL_CALL Formula2( ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ) SAL_OVERRIDE; virtual void setFormula1( const css::uno::Any& _aFormula1) throw ( css::script::BasicErrorException ); - virtual void setFormula2( const css::uno::Any& _aFormula2) throw ( css::script::BasicErrorException ); virtual sal_Int32 Operator(bool _bIncludeFormulaValue) throw ( css::script::BasicErrorException ); - virtual sal_Int32 SAL_CALL Operator() throw ( css::script::BasicErrorException, css::uno::RuntimeException ) = 0; + virtual sal_Int32 SAL_CALL Operator() throw ( css::script::BasicErrorException, css::uno::RuntimeException ) SAL_OVERRIDE = 0; }; #endif diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index c502226782fd..792818c97c66 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -115,12 +115,6 @@ ScVbaFormatCondition::setFormula1( const uno::Any& _aFormula1) throw ( script::B ScVbaFormatCondition_BASE::setFormula1( uno::makeAny( ScVbaFormatConditions::getA1Formula(_aFormula1) ) ); } -void -ScVbaFormatCondition::setFormula2( const uno::Any& _aFormula2) throw ( script::BasicErrorException ) -{ - ScVbaFormatCondition_BASE::setFormula1( uno::makeAny( ScVbaFormatConditions::getA1Formula(_aFormula2)) ); -} - ::sal_Int32 SAL_CALL ScVbaFormatCondition::Type( ) throw ( script::BasicErrorException, uno::RuntimeException, std::exception ) { diff --git a/sc/source/ui/vba/vbaformatcondition.hxx b/sc/source/ui/vba/vbaformatcondition.hxx index 70003e883379..4911656843ac 100644 --- a/sc/source/ui/vba/vbaformatcondition.hxx +++ b/sc/source/ui/vba/vbaformatcondition.hxx @@ -56,7 +56,6 @@ public: virtual ::sal_Int32 Operator( bool ) throw (css::script::BasicErrorException) override; virtual ::sal_Int32 SAL_CALL Operator( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) override; virtual void setFormula1( const css::uno::Any& _aFormula1) throw ( css::script::BasicErrorException ) override; - virtual void setFormula2( const css::uno::Any& _aFormula2) throw ( css::script::BasicErrorException ) override; virtual css::uno::Reference< ::ooo::vba::excel::XInterior > SAL_CALL Interior( ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Reference< ::ooo::vba::excel::XFont > SAL_CALL Font( ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) override; diff --git a/sc/source/ui/vba/vbapagebreak.hxx b/sc/source/ui/vba/vbapagebreak.hxx index 611dc54c4903..01a12cbf9272 100644 --- a/sc/source/ui/vba/vbapagebreak.hxx +++ b/sc/source/ui/vba/vbapagebreak.hxx @@ -43,11 +43,11 @@ public: css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException); virtual ~ScVbaPageBreak(){} - virtual sal_Int32 SAL_CALL getType( ) throw (css::uno::RuntimeException); - virtual void SAL_CALL setType(sal_Int32 type) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getType( ) throw (css::uno::RuntimeException) SAL_OVERRIDE; + virtual void SAL_CALL setType(sal_Int32 type) throw (css::uno::RuntimeException) SAL_OVERRIDE; - virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Reference< ov::excel::XRange> SAL_CALL Location() throw ( css::script::BasicErrorException, css::uno::RuntimeException); + virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE; + virtual css::uno::Reference< ov::excel::XRange> SAL_CALL Location() throw ( css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE; }; typedef ScVbaPageBreak < ov::excel::XHPageBreak > ScVbaHPageBreak_BASE; diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx index 53d7db4494f9..fa85c2de0712 100644 --- a/sc/source/ui/vba/vbatitle.hxx +++ b/sc/source/ui/vba/vbatitle.hxx @@ -47,7 +47,7 @@ public: xShapePropertySet.set( xTitleShape, css::uno::UNO_QUERY_THROW ); oShapeHelper.reset( new ov::ShapeHelper(xTitleShape) ); } - css::uno::Reference< ov::excel::XInterior > SAL_CALL Interior( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + css::uno::Reference< ov::excel::XInterior > SAL_CALL Interior( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { // #TODO find out what the proper parent should be // leaving as set by the helperapi for the moment @@ -55,14 +55,14 @@ public: // otherwise attempts to access the palette will fail return new ScVbaInterior( BaseClass::mxParent, BaseClass::mxContext, xShapePropertySet ); } - css::uno::Reference< ov::excel::XFont > SAL_CALL Font( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + css::uno::Reference< ov::excel::XFont > SAL_CALL Font( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { // #TODO find out what the proper parent should be // leaving as set by the helperapi for the moment return new ScVbaFont( BaseClass::mxParent, BaseClass::mxContext, m_Palette, xShapePropertySet ); } - void SAL_CALL setText( const OUString& Text ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + void SAL_CALL setText( const OUString& Text ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { try { @@ -73,7 +73,7 @@ public: throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), ERRCODE_BASIC_METHOD_FAILED, OUString() ); } } - OUString SAL_CALL getText( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + OUString SAL_CALL getText( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { OUString sText; try @@ -87,31 +87,23 @@ public: return sText; } - css::uno::Reference< ov::excel::XCharacters > SAL_CALL Characters( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) - { - // #FIXME #TODO the helperapi Characters implementation doesn't - // seem to do very much, need to know how the existing Characters - // impl ( that we use for Range ) can be reused - return css::uno::Reference< ov::excel::XCharacters > (); - } - - void SAL_CALL setTop( double Top ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + void SAL_CALL setTop( double Top ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { oShapeHelper->setTop( Top ); } - double SAL_CALL getTop( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + double SAL_CALL getTop( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { return oShapeHelper->getTop(); } - void SAL_CALL setLeft( double Left ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + void SAL_CALL setLeft( double Left ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { oShapeHelper->setLeft( Left ); } - double SAL_CALL getLeft( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + double SAL_CALL getLeft( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { return oShapeHelper->getLeft(); } - void SAL_CALL setOrientation( ::sal_Int32 _nOrientation ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + void SAL_CALL setOrientation( ::sal_Int32 _nOrientation ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { try { @@ -122,7 +114,7 @@ public: throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), ERRCODE_BASIC_METHOD_FAILED, OUString() ); } } - ::sal_Int32 SAL_CALL getOrientation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) + ::sal_Int32 SAL_CALL getOrientation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE { sal_Int32 nSOOrientation = 0; try @@ -136,11 +128,11 @@ public: return static_cast< sal_Int32 >(nSOOrientation / 100) ; } // XHelperInterface - OUString getServiceImplName() + OUString getServiceImplName() SAL_OVERRIDE { return OUString("TitleImpl"); } - css::uno::Sequence< OUString > getServiceNames() + css::uno::Sequence< OUString > getServiceNames() SAL_OVERRIDE { static css::uno::Sequence< OUString > aServiceNames; if ( aServiceNames.getLength() == 0 ) diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index e2259fbedd01..6041bce5cbc3 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -540,15 +540,6 @@ inline double GetYearFrac( const css::uno::Reference< css::beans::XPropertySet > } -inline void AlignDate( sal_uInt16& rD, sal_uInt16 nM, sal_uInt16 nY ) -{ - sal_uInt16 nMax = DaysInMonth( nM, nY ); - - if( rD > nMax ) - rD = nMax; -} - - inline sal_uInt16 FuncData::GetUINameID() const { return nUINameID; diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index f378894d7746..a1d863d18ce8 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -783,19 +783,6 @@ storeError OStorePageBIOS::releasePage (const OStorePageDescriptor& rDescr) } /* - * getRefererCount. - * Precond: none. - */ -sal_uInt32 OStorePageBIOS::getRefererCount() -{ - // Acquire exclusive access. - osl::MutexGuard aGuard (m_aMutex); - - // Obtain total referer count. - return m_ace_head.m_used; -} - -/* * allocate. * Precond: initialized, writeable. */ @@ -1004,101 +991,5 @@ storeError OStorePageBIOS::size (sal_uInt32 &rnSize) return m_xLockBytes->getSize (rnSize); } -/* - * scanBegin. - * Precond: initialized. - */ -storeError OStorePageBIOS::scanBegin ( - ScanContext &rCtx, sal_uInt32 nMagic) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard (m_aMutex); - - // Initialize [out] param. - rCtx.m_aDescr = OStorePageDescriptor(0, 0, 0); - rCtx.m_nSize = 0; - rCtx.m_nMagic = nMagic; - - // Check precond. - if (!m_xLockBytes.is()) - return store_E_InvalidAccess; - - // Check SuperBlock page. - storeError eErrCode = m_pSuper->verify (*this); - if (eErrCode != store_E_None) - { - // Damaged. Determine page size (NYI). - OSL_TRACE ("OStorePageBIOS::scanBegin(): damaged.\n"); - return eErrCode; - } - - // Setup Context descriptor. - rCtx.m_aDescr = m_pSuper->m_aSuperOne.m_aDescr; - rCtx.m_aDescr.m_nSize = store::ntohs(rCtx.m_aDescr.m_nSize); - rCtx.m_aDescr.m_nAddr = rCtx.m_aDescr.m_nSize; - - // Setup Context size. - eErrCode = size (rCtx.m_nSize); - if (eErrCode != store_E_None) - rCtx.m_nSize = ((sal_uInt32)(~0)); - - // Done. - return store_E_None; -} - -/* - * scanNext. - * Precond: initialized. - */ -storeError OStorePageBIOS::scanNext ( - ScanContext &rCtx, OStorePageObject &rPage) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard (m_aMutex); - - // Check precond. - if (!m_xLockBytes.is()) - return store_E_InvalidAccess; - - // Setup PageHead. - PageData aPageHead; - - // Check context. - while (rCtx.isValid()) - { - // Assign next location. - sal_uInt32 nAddr = rCtx.m_aDescr.m_nAddr; - rCtx.m_aDescr.m_nAddr += rCtx.m_aDescr.m_nSize; - - // Read PageHead. - storeError eErrCode = read (nAddr, &aPageHead, PageData::theSize); - if (eErrCode != store_E_None) - continue; - - // Verify PageHead. - eErrCode = aPageHead.verify (nAddr); - if (eErrCode != store_E_None) - continue; - - // Check PageHead Magic number. - if (aPageHead.m_aGuard.m_nMagic != rCtx.m_nMagic) - continue; - - // Check PageHead Unused link. - if (aPageHead.m_aUnused.m_nAddr != STORE_PAGE_NULL) - continue; - - // Load page. - eErrCode = loadObjectAt_Impl (rPage, nAddr); - if (eErrCode != store_E_None) - continue; - - // Deliver page. - return store_E_None; - } - - // Done. - return store_E_CantSeek; -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storbios.hxx b/store/source/storbios.hxx index 2f8a4db0b295..2c93acd1126b 100644 --- a/store/source/storbios.hxx +++ b/store/source/storbios.hxx @@ -92,8 +92,6 @@ public: storeError releasePage (const OStorePageDescriptor& rDescr); - sal_uInt32 getRefererCount(); - /** Page Allocation. */ enum Allocation @@ -149,18 +147,6 @@ public: inline bool isValid() const; }; - /** scanBegin. - */ - storeError scanBegin ( - ScanContext &rCtx, - sal_uInt32 nMagic = 0); - - /** scanNext. - */ - storeError scanNext ( - ScanContext &rCtx, - OStorePageObject &rPage); - protected: /** Destruction (OReference). */ diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 90e5cdaf7933..640c5847426a 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -664,10 +664,6 @@ public: /** key. */ - OStorePageKey key() const - { - return PAGE().m_aNameBlock.m_aKey; - } void key (OStorePageKey const & rKey) { PAGE().m_aNameBlock.m_aKey = rKey; diff --git a/store/source/store.cxx b/store/source/store.cxx index 1b5107fc3837..beedbee91ea7 100644 --- a/store/source/store.cxx +++ b/store/source/store.cxx @@ -200,77 +200,6 @@ storeError SAL_CALL store_flushFile ( return xManager->flush(); } -/* - * store_getFileRefererCount. - */ -storeError SAL_CALL store_getFileRefererCount ( - storeFileHandle Handle, - sal_uInt32 *pnRefCount -) SAL_THROW_EXTERN_C() -{ - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!pnRefCount) - return store_E_InvalidParameter; - - *pnRefCount = xManager->getRefererCount(); - return store_E_None; -} - -/* - * store_getFileSize. - */ -storeError SAL_CALL store_getFileSize ( - storeFileHandle Handle, - sal_uInt32 *pnSize -) SAL_THROW_EXTERN_C() -{ - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!pnSize) - return store_E_InvalidParameter; - - return xManager->size (*pnSize); -} - -/* - * store_rebuildFile. - */ -storeError SAL_CALL store_rebuildFile ( - rtl_uString *pSrcFilename, - rtl_uString *pDstFilename -) SAL_THROW_EXTERN_C() -{ - storeError eErrCode = store_E_None; - - if (!(pSrcFilename && pDstFilename)) - return store_E_InvalidParameter; - - Reference<OStorePageManager> xManager (new OStorePageManager()); - if (!xManager.is()) - return store_E_OutOfMemory; - - Reference<ILockBytes> xSrcLB; - eErrCode = FileLockBytes_createInstance (xSrcLB, pSrcFilename, store_AccessReadOnly); - if (eErrCode != store_E_None) - return eErrCode; - OSL_ASSERT(xSrcLB.is()); - - Reference<ILockBytes> xDstLB; - eErrCode = FileLockBytes_createInstance (xDstLB, pDstFilename, store_AccessCreate); - if (eErrCode != store_E_None) - return eErrCode; - OSL_ASSERT(xDstLB.is()); - - return xManager->rebuild (&*xSrcLB, &*xDstLB); -} - /*======================================================================== * * storeDirectoryHandle implementation. @@ -317,22 +246,6 @@ storeError SAL_CALL store_openDirectory ( } /* - * store_closeDirectory. - */ -storeError SAL_CALL store_closeDirectory ( - storeDirectoryHandle Handle -) SAL_THROW_EXTERN_C() -{ - OStoreDirectory_Impl *pDirectory = - OStoreHandle<OStoreDirectory_Impl>::query (Handle); - if (!pDirectory) - return store_E_InvalidHandle; - - pDirectory->release(); - return store_E_None; -} - -/* * store_findFirst. */ storeError SAL_CALL store_findFirst ( @@ -427,22 +340,6 @@ storeError SAL_CALL store_openStream ( } /* - * store_closeStream. - */ -storeError SAL_CALL store_closeStream ( - storeStreamHandle Handle -) SAL_THROW_EXTERN_C() -{ - OStoreLockBytes *pLockBytes = - OStoreHandle<OStoreLockBytes>::query (Handle); - if (!pLockBytes) - return store_E_InvalidHandle; - - pLockBytes->release(); - return store_E_None; -} - -/* * store_readStream. */ storeError SAL_CALL store_readStream ( @@ -487,238 +384,6 @@ storeError SAL_CALL store_writeStream ( } /* - * store_flushStream. - */ -storeError SAL_CALL store_flushStream ( - storeStreamHandle Handle -) SAL_THROW_EXTERN_C() -{ - OStoreHandle<OStoreLockBytes> xLockBytes ( - OStoreHandle<OStoreLockBytes>::query (Handle)); - if (!xLockBytes.is()) - return store_E_InvalidHandle; - - return xLockBytes->flush(); -} - -/* - * store_getStreamSize. - */ -storeError SAL_CALL store_getStreamSize ( - storeStreamHandle Handle, - sal_uInt32 *pnSize -) SAL_THROW_EXTERN_C() -{ - OStoreHandle<OStoreLockBytes> xLockBytes ( - OStoreHandle<OStoreLockBytes>::query (Handle)); - if (!xLockBytes.is()) - return store_E_InvalidHandle; - - if (!pnSize) - return store_E_InvalidParameter; - - return xLockBytes->stat (*pnSize); -} - -/* - * store_setStreamSize. - */ -storeError SAL_CALL store_setStreamSize ( - storeStreamHandle Handle, - sal_uInt32 nSize -) SAL_THROW_EXTERN_C() -{ - OStoreHandle<OStoreLockBytes> xLockBytes ( - OStoreHandle<OStoreLockBytes>::query (Handle)); - if (!xLockBytes.is()) - return store_E_InvalidHandle; - - return xLockBytes->setSize (nSize); -} - -/*======================================================================== - * - * Common storeDirectoryHandle and storeStreamHandle operations. - * - *======================================================================*/ -/* - * store_attrib. - */ -storeError SAL_CALL store_attrib ( - storeFileHandle Handle, - rtl_uString *pPath, - rtl_uString *pName, - sal_uInt32 nMask1, - sal_uInt32 nMask2, - sal_uInt32 *pnAttrib -) SAL_THROW_EXTERN_C() -{ - storeError eErrCode = store_E_None; - if (pnAttrib) - *pnAttrib = 0; - - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!(pPath && pName)) - return store_E_InvalidParameter; - - // Setup page key. - OString aPath (pPath->buffer, pPath->length, RTL_TEXTENCODING_UTF8); - OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8); - OStorePageKey aKey; - - eErrCode = OStorePageManager::namei (aPath.pData, aName.pData, aKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Obtain or modify page attributes. - sal_uInt32 nAttrib = 0; - eErrCode = xManager->attrib (aKey, nMask1, nMask2, nAttrib); - if (pnAttrib) - *pnAttrib = nAttrib; - return eErrCode; -} - -/* - * store_link. - */ -storeError SAL_CALL store_link ( - storeFileHandle Handle, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C() -{ - storeError eErrCode = store_E_None; - - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!(pSrcPath && pSrcName)) - return store_E_InvalidParameter; - - if (!(pDstPath && pDstName)) - return store_E_InvalidParameter; - - // Setup 'Source' page key. - OString aSrcPath ( - pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8); - OString aSrcName ( - pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8); - OStorePageKey aSrcKey; - - eErrCode = OStorePageManager::namei ( - aSrcPath.pData, aSrcName.pData, aSrcKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Setup 'Destination' page key. - OString aDstPath ( - pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8); - OString aDstName ( - pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8); - OStorePageKey aDstKey; - - eErrCode = OStorePageManager::namei ( - aDstPath.pData, aDstName.pData, aDstKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Link 'Source' hard to 'Destination'. - return xManager->link (aSrcKey, aDstKey); -} - -/* - * store_symlink. - */ -storeError SAL_CALL store_symlink ( - storeFileHandle Handle, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C() -{ - storeError eErrCode = store_E_None; - - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!(pSrcPath && pSrcName)) - return store_E_InvalidParameter; - - if (!(pDstPath && pDstName)) - return store_E_InvalidParameter; - - // Setup 'Destination' page key. - OString aDstPath ( - pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8); - OString aDstName ( - pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8); - OStorePageKey aDstKey; - - eErrCode = OStorePageManager::namei ( - aDstPath.pData, aDstName.pData, aDstKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Insert 'Source' as symlink to 'Destination'. - OString aSrcPath ( - pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8); - OString aSrcName ( - pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8); - - return xManager->symlink (aSrcPath.pData, aSrcName.pData, aDstKey); -} - -/* - * store_rename. - */ -storeError SAL_CALL store_rename ( - storeFileHandle Handle, - rtl_uString *pSrcPath, rtl_uString *pSrcName, - rtl_uString *pDstPath, rtl_uString *pDstName -) SAL_THROW_EXTERN_C() -{ - storeError eErrCode = store_E_None; - - OStoreHandle<OStorePageManager> xManager ( - OStoreHandle<OStorePageManager>::query (Handle)); - if (!xManager.is()) - return store_E_InvalidHandle; - - if (!(pSrcPath && pSrcName)) - return store_E_InvalidParameter; - - if (!(pDstPath && pDstName)) - return store_E_InvalidParameter; - - // Setup 'Source' page key. - OString aSrcPath ( - pSrcPath->buffer, pSrcPath->length, RTL_TEXTENCODING_UTF8); - OString aSrcName ( - pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8); - OStorePageKey aSrcKey; - - eErrCode = OStorePageManager::namei ( - aSrcPath.pData, aSrcName.pData, aSrcKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Rename 'Source' into 'Destination'. - OString aDstPath ( - pDstPath->buffer, pDstPath->length, RTL_TEXTENCODING_UTF8); - OString aDstName ( - pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8); - - return xManager->rename (aSrcKey, aDstPath.pData, aDstName.pData); -} - -/* * store_remove. */ storeError SAL_CALL store_remove ( diff --git a/store/source/storlckb.cxx b/store/source/storlckb.cxx index b6afa2d086c8..0e74ab931974 100644 --- a/store/source/storlckb.cxx +++ b/store/source/storlckb.cxx @@ -349,17 +349,6 @@ storeError OStoreLockBytes::writeAt ( } /* - * flush. - */ -storeError OStoreLockBytes::flush() -{ - if (!m_xManager.is()) - return store_E_InvalidAccess; - - return m_xManager->flush(); -} - -/* * setSize. */ storeError OStoreLockBytes::setSize (sal_uInt32 nSize) @@ -426,19 +415,4 @@ storeError OStoreLockBytes::setSize (sal_uInt32 nSize) return m_xManager->saveObjectAt (aPage, aPage.location()); } -/* - * stat. - */ -storeError OStoreLockBytes::stat (sal_uInt32 &rnSize) -{ - rnSize = 0; - - if (!m_xManager.is()) - return store_E_InvalidAccess; - - OStoreDirectoryPageObject aPage (m_xNode.get()); - rnSize = aPage.dataLength(); - return store_E_None; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx index 184f14ccca03..c49993a55b8b 100644 --- a/store/source/storlckb.hxx +++ b/store/source/storlckb.hxx @@ -86,23 +86,12 @@ public: sal_uInt32 nBytes, sal_uInt32 &rnDone); - /** flush. - * @return store_E_None upon success - */ - storeError flush(); - /** setSize. * @param nSize [in] * @return store_E_None upon success */ storeError setSize (sal_uInt32 nSize); - /** stat. - * @paran rnSize [out] - * @return store_E_None upon success - */ - storeError stat (sal_uInt32 &rnSize); - /** IStoreHandle. */ virtual bool isKindOf (sal_uInt32 nMagic) override; diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx index a50182681174..2892908599c1 100644 --- a/store/source/storpage.cxx +++ b/store/source/storpage.cxx @@ -437,282 +437,6 @@ storeError OStorePageManager::save_dirpage_Impl ( } /* - * attrib [nAttrib = ((nAttrib & ~nMask1) | nMask2)]. - * Precond: initialized. - */ -storeError OStorePageManager::attrib ( - const OStorePageKey &rKey, - sal_uInt32 nMask1, - sal_uInt32 nMask2, - sal_uInt32 &rAttrib) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard(*this); - - // Check precond. - if (!self::isValid()) - return store_E_InvalidAccess; - - // Find NodePage and index. - OStoreBTreeNodeObject aNode; - sal_uInt16 i = 0; - storeError eErrCode = find_lookup (aNode, i, rKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Existing entry. - PageHolderObject< page > xNode (aNode.get()); - entry e (xNode->m_pData[i]); - if (nMask1 != nMask2) - { - // Evaluate new attributes. - sal_uInt32 nAttrib = store::ntohl(e.m_nAttrib); - - nAttrib &= ~nMask1; - nAttrib |= nMask2; - - if (store::htonl(nAttrib) != e.m_nAttrib) - { - // Check access mode. - if (base::isWriteable()) - { - // Set new attributes. - e.m_nAttrib = store::htonl(nAttrib); - xNode->m_pData[i] = e; - - // Save modified NodePage. - eErrCode = saveObjectAt (aNode, aNode.location()); - } - else - { - // Access denied. - eErrCode = store_E_AccessViolation; - } - } - } - - // Obtain current attributes. - rAttrib = store::ntohl(e.m_nAttrib); - return eErrCode; -} - -/* - * link (insert 'Source' as hardlink to 'Destination'). - * Precond: initialized, writeable. - */ -storeError OStorePageManager::link ( - const OStorePageKey &rSrcKey, - const OStorePageKey &rDstKey) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard(*this); - - // Check precond. - if (!self::isValid()) - return store_E_InvalidAccess; - - if (!base::isWriteable()) - return store_E_AccessViolation; - - // Find 'Destination' NodePage and Index. - OStoreBTreeNodeObject aDstNode; - sal_uInt16 i = 0; - storeError eErrCode = find_lookup (aDstNode, i, rDstKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Existing 'Destination' entry. - PageHolderObject< page > xDstNode (aDstNode.get()); - entry e (xDstNode->m_pData[i]); - OStorePageLink aDstLink (e.m_aLink); - - // Find 'Source' NodePage and Index. - OStoreBTreeNodeObject aSrcNode; - eErrCode = m_aRoot.find_insert (aSrcNode, i, rSrcKey, *this); - if (eErrCode != store_E_None) - return eErrCode; - - // Insert 'Source' entry. - PageHolderObject< page > xSrcNode (aSrcNode.get()); - xSrcNode->insert (i + 1, entry (rSrcKey, aDstLink, STORE_ATTRIB_ISLINK)); - return saveObjectAt (aSrcNode, aSrcNode.location()); -} - -/* - * symlink (insert 'Source' DirectoryPage as symlink to 'Destination'). - * Precond: initialized, writeable. - */ -storeError OStorePageManager::symlink ( - const rtl_String *pSrcPath, - const rtl_String *pSrcName, - const OStorePageKey &rDstKey) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard(*this); - - // Check precond. - if (!self::isValid()) - return store_E_InvalidAccess; - - if (!base::isWriteable()) - return store_E_AccessViolation; - - // Check 'Source' parameter. - storeError eErrCode = store_E_InvalidParameter; - if (!(pSrcPath && pSrcName)) - return eErrCode; - - // Setup 'Source' page key. - OStorePageKey aSrcKey; - eErrCode = namei (pSrcPath, pSrcName, aSrcKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Find 'Source' NodePage and Index. - OStoreBTreeNodeObject aSrcNode; - sal_uInt16 i = 0; - eErrCode = m_aRoot.find_insert (aSrcNode, i, aSrcKey, *this); - if (eErrCode != store_E_None) - return eErrCode; - - // Initialize directory page. - OStoreDirectoryPageObject aPage; - eErrCode = aPage.construct< inode >(base::allocator()); - if (eErrCode != store_E_None) - return eErrCode; - - // Setup as 'Source' directory page. - inode_holder_type xNode (aPage.get()); - aPage.key (aSrcKey); - memcpy ( - &(xNode->m_aNameBlock.m_pData[0]), - pSrcName->buffer, pSrcName->length); - - // Store 'Destination' page key. - OStorePageKey aDstKey (rDstKey); - memcpy (&(xNode->m_pData[0]), &aDstKey, sizeof(aDstKey)); - - // Mark 'Source' as symbolic link to 'Destination'. - aPage.attrib (STORE_ATTRIB_ISLINK); - aPage.dataLength (sal_uInt32(sizeof(aDstKey))); - - // Allocate and save 'Source' directory page. - eErrCode = base::allocate (aPage); - if (eErrCode != store_E_None) - return eErrCode; - - // Insert 'Source' entry. - PageHolderObject< page > xSrcNode (aSrcNode.get()); - OStorePageLink aSrcLink (aPage.location()); - xSrcNode->insert (i + 1, entry(aSrcKey, aSrcLink)); - - // Save modified NodePage. - return saveObjectAt (aSrcNode, aSrcNode.location()); -} - -/* - * rename. - * Precond: initialized, writeable. - */ -storeError OStorePageManager::rename ( - const OStorePageKey &rSrcKey, - const rtl_String *pDstPath, - const rtl_String *pDstName) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard(*this); - - // Check precond. - if (!self::isValid()) - return store_E_InvalidAccess; - - if (!base::isWriteable()) - return store_E_AccessViolation; - - // Check 'Destination' parameter. - storeError eErrCode = store_E_InvalidParameter; - if (!(pDstPath && pDstName)) - return eErrCode; - - // Setup 'Destination' page key. - OStorePageKey aDstKey; - eErrCode = namei (pDstPath, pDstName, aDstKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Find 'Source' NodePage and Index. - OStoreBTreeNodeObject aSrcNode; - sal_uInt16 i = 0; - eErrCode = find_lookup (aSrcNode, i, rSrcKey); - if (eErrCode != store_E_None) - return eErrCode; - - // Existing 'Source' entry. - PageHolderObject< page > xSrcNode (aSrcNode.get()); - entry e (xSrcNode->m_pData[i]); - - // Check for (not a) hardlink. - OStoreDirectoryPageObject aPage; - if (!(store::ntohl(e.m_nAttrib) & STORE_ATTRIB_ISLINK)) - { - // Load directory page. - eErrCode = base::loadObjectAt (aPage, e.m_aLink.location()); - if (eErrCode != store_E_None) - return eErrCode; - - // Check for directory. - if (aPage.attrib() & STORE_ATTRIB_ISDIR) - { - // Ugly, but necessary (backward compatibility). - aDstKey.m_nLow = store::htonl(rtl_crc32 (store::ntohl(aDstKey.m_nLow), "/", 1)); - } - } - - // Let 'Source' entry be 'Destination' entry. - e.m_aKey = aDstKey; - - // Find 'Destination' NodePage and Index. - OStoreBTreeNodeObject aDstNode; - eErrCode = m_aRoot.find_insert (aDstNode, i, e.m_aKey, *this); - if (eErrCode != store_E_None) - return eErrCode; - - // Insert 'Destination' entry. - PageHolderObject< page > xDstNode (aDstNode.get()); - xDstNode->insert (i + 1, e); - - eErrCode = saveObjectAt (aDstNode, aDstNode.location()); - if (eErrCode != store_E_None) - return eErrCode; - - // Check for (not a) hardlink. - if (!(store::ntohl(e.m_nAttrib) & STORE_ATTRIB_ISLINK)) - { - // Modify 'Source' directory page. - inode_holder_type xNode (aPage.get()); - - // Setup 'Destination' NameBlock. - sal_Int32 nDstLen = pDstName->length; - memcpy ( - &(xNode->m_aNameBlock.m_pData[0]), - pDstName->buffer, pDstName->length); - memset ( - &(xNode->m_aNameBlock.m_pData[nDstLen]), - 0, STORE_MAXIMUM_NAMESIZE - nDstLen); - aPage.key (e.m_aKey); - - // Save directory page. - eErrCode = base::saveObjectAt (aPage, e.m_aLink.location()); - if (eErrCode != store_E_None) - return eErrCode; - } - - // Remove 'Source' entry. - e.m_aKey = rSrcKey; - return remove_Impl (e); -} - -/* * remove. * Precond: initialized, writeable. */ @@ -785,201 +509,5 @@ storeError OStorePageManager::remove (const OStorePageKey &rKey) return remove_Impl (e); } -/* - * RebuildContext. - */ -struct RebuildContext -{ - /** Representation. - */ - rtl::Reference<OStorePageBIOS> m_xBIOS; - OStorePageBIOS::ScanContext m_aCtx; - sal_uInt16 m_nPageSize; - - /** Construction. - */ - RebuildContext() - : m_xBIOS (new OStorePageBIOS()), - m_nPageSize (0) - {} - - /** initialize (PageBIOS and ScanContext). - */ - storeError initialize (ILockBytes *pLockBytes, sal_uInt32 nMagic = 0) - { - storeError eErrCode = store_E_InvalidParameter; - if (pLockBytes) - { - m_xBIOS->initialize (pLockBytes, store_AccessReadOnly, m_nPageSize); - eErrCode = m_xBIOS->scanBegin (m_aCtx, nMagic); - } - return eErrCode; - } - - /** initialize (ScanContext). - */ - storeError initialize (sal_uInt32 nMagic = 0) - { - return m_xBIOS->scanBegin (m_aCtx, nMagic); - } - - /** load (next ScanContext matching page). - */ - storeError load (OStorePageObject &rPage) - { - if (m_aCtx.isValid()) - return m_xBIOS->scanNext (m_aCtx, rPage); - else - return store_E_CantSeek; - } -}; - -/* - * rebuild. - * Precond: none. - */ -storeError OStorePageManager::rebuild ( - ILockBytes *pSrcLB, ILockBytes *pDstLB) -{ - // Acquire exclusive access. - osl::MutexGuard aGuard(*this); - - // Check arguments. - storeError eErrCode = store_E_InvalidParameter; - if (!(pSrcLB && pDstLB)) - return eErrCode; - - // Initialize 'Source' rebuild context. - RebuildContext aCtx; - eErrCode = aCtx.initialize (pSrcLB, STORE_MAGIC_DIRECTORYPAGE); - if (eErrCode != store_E_None) - return eErrCode; - rtl::Reference<OStorePageBIOS> xSrcBIOS (aCtx.m_xBIOS); - - // Initialize as 'Destination' with 'Source' page size. - eErrCode = self::initialize (pDstLB, store_AccessCreate, aCtx.m_nPageSize); - if (eErrCode != store_E_None) - return eErrCode; - - // Pass One: Scan 'Source' directory pages. - { - // Scan 'Source' directory pages. - OStoreDirectoryPageObject aSrcPage; - while ((eErrCode = aCtx.load(aSrcPage)) == store_E_None) - { - OStoreDirectoryPageObject aDstPage; - eErrCode = aDstPage.construct< inode >(base::allocator()); - if (eErrCode != store_E_None) - break; - - inode_holder_type xSrcDir (aSrcPage.get()); - inode_holder_type xDstDir (aDstPage.get()); - - // Copy NameBlock @@@ OLD @@@ - memcpy (&(xDstDir->m_aNameBlock), &(xSrcDir->m_aNameBlock), sizeof(xSrcDir->m_aNameBlock)); - - // Obtain 'Source' data length. - sal_uInt32 nDataLen = aSrcPage.dataLength(); - if (nDataLen > 0) - { - // Copy internal data area @@@ OLD @@@ - memcpy (&(xDstDir->m_pData[0]), &(xSrcDir->m_pData[0]), xSrcDir->capacity()); - } - - // Insert 'Destination' directory page. - eErrCode = save_dirpage_Impl (aDstPage.key(), aDstPage); - if (eErrCode != store_E_None) - break; - - // Check for external data page scope. - if (xSrcDir->scope(nDataLen) != inode::SCOPE_INTERNAL) - { - // Initialize 'Destination' data page. - typedef OStoreDataPageData data; - PageHolderObject< data > xData; - if (!xData.construct(base::allocator())) - return store_E_OutOfMemory; - - // Determine data page count. - inode::ChunkDescriptor aDescr ( - nDataLen - xDstDir->capacity(), xData->capacity()); - - sal_uInt32 i, n = aDescr.m_nPage; - if (aDescr.m_nOffset) n += 1; - - // Copy data pages. - OStoreDataPageObject aData; - for (i = 0; i < n; i++) - { - // Read 'Source' data page. - osl::MutexGuard aSrcGuard (*xSrcBIOS); - - eErrCode = aSrcPage.read (i, aData, *xSrcBIOS); - if (eErrCode != store_E_None) - continue; - - // Write 'Destination' data page. @@@ READONLY @@@ - (void) aDstPage.write (i, aData, *this); - } - } - - // Update 'Destination' directory page. - aDstPage.dataLength (nDataLen); - (void) base::saveObjectAt (aDstPage, aDstPage.location()); - } - - // Save directory scan results. - flush(); - } - - // Pass Two: Scan 'Source' BTree nodes. - { - // Re-start 'Source' rebuild context. - aCtx.initialize (STORE_MAGIC_BTREENODE); - - // Scan 'Source' BTree nodes. - OStoreBTreeNodeObject aNode; - while ((eErrCode = aCtx.load(aNode)) == store_E_None) - { - // Check for leaf node. - PageHolderObject< page > xNode (aNode.get()); - if (xNode->depth() == 0) - { - sal_uInt16 i, n = xNode->usageCount(); - for (i = 0; i < n; i++) - { - entry e (xNode->m_pData[i]); - - // Check for Hard link. - if (e.m_nAttrib & STORE_ATTRIB_ISLINK) - { - // Load the hard link destination. - OStoreDirectoryPageObject aSrcPage; - eErrCode = xSrcBIOS->loadObjectAt (aSrcPage, e.m_aLink.location()); - if (eErrCode == store_E_None) - { - OStorePageKey aDstKey (aSrcPage.key()); - link (e.m_aKey, aDstKey); - } - e.m_nAttrib &= ~STORE_ATTRIB_ISLINK; - } - - if (e.m_nAttrib) - { - // Ordinary attributes. - sal_uInt32 nAttrib = 0; - attrib (e.m_aKey, 0, e.m_nAttrib, nAttrib); - } - } - } - } - - // Save BTree node scan results. - flush(); - } - - // Done. - return store_E_None; -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx index cdeeea68e2e2..1dfeb048d777 100644 --- a/store/source/storpage.hxx +++ b/store/source/storpage.hxx @@ -79,55 +79,12 @@ public: OStorePageLink & rLink, sal_uInt32 & rAttrib); - /** attrib [nAttrib = ((nAttrib & ~nMask1) | nMask2)]. - * @see store_attrib() - */ - storeError attrib ( - const OStorePageKey &rKey, - sal_uInt32 nMask1, - sal_uInt32 nMask2, - sal_uInt32 &rAttrib); - - /** link (insert Source Key as hardlink to Destination). - * @see store_link() - */ - storeError link ( - const OStorePageKey &rSrcKey, - const OStorePageKey &rDstKey); - - /** symlink (insert Source DirectoryPage as symlink to Destination). - * @see store_symlink() - */ - storeError symlink ( - const rtl_String *pSrcPath, - const rtl_String *pSrcName, - const OStorePageKey &rDstKey); - - /** rename. - * @see store_rename() - */ - storeError rename ( - const OStorePageKey &rSrcKey, - const rtl_String *pDstPath, - const rtl_String *pDstName); - /** remove. * @see store_remove() */ storeError remove ( const OStorePageKey &rKey); - /** rebuild (combines recover and compact from 'Src' to 'Dst'). - * @param pSrcLB [in] accessed readonly. - * @param pDstLB [in] truncated and accessed readwrite (as initialize()). - * @return store_E_None upon success. - * - * @see store_rebuildFile() - */ - storeError rebuild ( - ILockBytes *pSrcLB, - ILockBytes *pDstLB); - /** IStoreHandle. */ virtual bool isKindOf (sal_uInt32 nTypeId) override; diff --git a/svl/source/inc/strmadpt.hxx b/svl/source/inc/strmadpt.hxx index 0e6d122a04d9..c91d61cd06cc 100644 --- a/svl/source/inc/strmadpt.hxx +++ b/svl/source/inc/strmadpt.hxx @@ -54,8 +54,6 @@ public: virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount, sal_uLong * pWritten) override; - - virtual void Terminate() override; }; #endif // INCLUDED_SVL_STRMADPT_HXX diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index c24291ecc501..367ea56db03f 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -208,22 +208,6 @@ ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer, return ERRCODE_NONE; } -// virtual -void SvOutputStreamOpenLockBytes::Terminate() -{ - if (m_xOutputStream.is()) - { - try - { - m_xOutputStream->closeOutput(); - } - catch (const io::IOException&) - { - } - } -} - - // SvInputStream diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx index 26001ee13da0..6a1c1a7b73cd 100644 --- a/svtools/source/graphic/grfattr.cxx +++ b/svtools/source/graphic/grfattr.cxx @@ -73,49 +73,4 @@ bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const -SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr ) -{ - VersionCompat aCompat( rIStm, StreamMode::READ ); - sal_uInt32 nTmp32, nTmpMirrFlags; - sal_uInt16 nTmp16; - - rIStm.ReadUInt32( nTmp32 ).ReadUInt32( nTmp32 ).ReadDouble( rAttr.mfGamma ).ReadUInt32( nTmpMirrFlags ).ReadUInt16( rAttr.mnRotate10 ); - rAttr.mnMirrFlags = static_cast<BmpMirrorFlags>(nTmpMirrFlags); - rIStm.ReadInt16( rAttr.mnContPercent ).ReadInt16( rAttr.mnLumPercent ).ReadInt16( rAttr.mnRPercent ).ReadInt16( rAttr.mnGPercent ).ReadInt16( rAttr.mnBPercent ); - rIStm.ReadCharAsBool( rAttr.mbInvert ).ReadUChar( rAttr.mcTransparency ).ReadUInt16( nTmp16 ); - rAttr.meDrawMode = (GraphicDrawMode) nTmp16; - - if( aCompat.GetVersion() >= 2 ) - { - sal_Int32 nTmpL(0), nTmpT(0), nTmpR(0), nTmpB(0); - rIStm.ReadInt32( nTmpL ).ReadInt32( nTmpT ).ReadInt32( nTmpR ).ReadInt32( nTmpB ); - rAttr.mnLeftCrop = nTmpL; - rAttr.mnTopCrop = nTmpT; - rAttr.mnRightCrop = nTmpR; - rAttr.mnBottomCrop = nTmpB; - } - - return rIStm; -} - - - -SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr ) -{ - VersionCompat aCompat( rOStm, StreamMode::WRITE, 2 ); - const sal_uInt32 nTmp32 = 0; - - rOStm.WriteUInt32( nTmp32 ).WriteUInt32( nTmp32 ); - rOStm.WriteDouble( rAttr.mfGamma ); - rOStm.WriteUInt32( static_cast<sal_uInt32>(rAttr.mnMirrFlags) ).WriteUInt16( rAttr.mnRotate10 ); - rOStm.WriteInt16( rAttr.mnContPercent ).WriteInt16( rAttr.mnLumPercent ).WriteInt16( rAttr.mnRPercent ).WriteInt16( rAttr.mnGPercent ).WriteInt16( rAttr.mnBPercent ); - rOStm.WriteBool( rAttr.mbInvert ).WriteUChar( rAttr.mcTransparency ).WriteUInt16( rAttr.meDrawMode ); - rOStm.WriteInt32( rAttr.mnLeftCrop ) - .WriteInt32( rAttr.mnTopCrop ) - .WriteInt32( rAttr.mnRightCrop ) - .WriteInt32( rAttr.mnBottomCrop ); - - return rOStm; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 726c96c07b03..4e4a87344a38 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -45,23 +45,6 @@ sal_uIntPtr UniqueIndexImpl::Insert( void* p ) return ( nUniqIndex + nStartIndex - 1 ); } -void UniqueIndexImpl::Insert( sal_uIntPtr nIndex, void* p ) -{ - // NULL-Pointer not allowed - if ( !p ) - return; - - sal_uIntPtr nContIndex = nIndex - nStartIndex; - - bool bFound = maMap.find( nContIndex ) != maMap.end(); - - // Insert object to array - maMap[ nContIndex ] = p; - - if( !bFound ) - nCount++; -} - void* UniqueIndexImpl::Remove( sal_uIntPtr nIndex ) { // Check for valid index diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 06ad8e55571d..89a405c13477 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -572,39 +572,4 @@ SvPersistStream& operator >> return rStm.ReadPointer( rpObj ); } -SvStream& operator >> -( - SvStream & rStm, - SvPersistStream & rThis -) -{ - SvStream * pOldStm = rThis.GetStream(); - rThis.SetStream( &rStm ); - - sal_uInt8 nVers; - rThis.ReadUChar( nVers ); // Version - if( 0 == nVers ) - { - sal_uInt32 nCount = 0; - rThis.ReadUInt32( nCount ); - for( sal_uInt32 i = 0; i < nCount; i++ ) - { - SvPersistBase * pEle; - // read, but don't insert into table - sal_uIntPtr nId = rThis.ReadObj( pEle, false ); - if( rThis.GetError() ) - break; - - // Id of object is never modified - rThis.aPUIdx.Insert( nId, pEle ); - rThis.aPTable[ pEle ] = nId; - } - } - else - rThis.SetError( SVSTREAM_FILEFORMAT_ERROR ); - - rThis.SetStream( pOldStm ); - return rStm; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx index 4358f2b90fb7..6782a94ca87b 100644 --- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx +++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx @@ -578,13 +578,4 @@ bool BitmapFilterStackBlur::filter(Bitmap& rBitmap) return true; } -bool BitmapFilterStackBlur::filter(BitmapEx& rBitmapEx) -{ - Bitmap aBitmap = rBitmapEx.GetBitmap(); - filter(aBitmap); - rBitmapEx = BitmapEx(aBitmap); - - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index f0bfbabdc783..8df7bfb7edab 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -346,17 +346,6 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumberForExtension( const OUString& return GRFILTER_FORMAT_NOTFOUND; } -sal_uInt16 FilterConfigCache::GetImportFormatNumberForMediaType( const OUString& rMediaType ) -{ - CacheVector::const_iterator aIter, aEnd; - for (aIter = aImport.begin(), aEnd = aImport.end(); aIter != aEnd; ++aIter) - { - if ( aIter->sMediaType.equalsIgnoreAsciiCase( rMediaType ) ) - return sal::static_int_cast< sal_uInt16 >(aIter - aImport.begin()); - } - return GRFILTER_FORMAT_NOTFOUND; -} - sal_uInt16 FilterConfigCache::GetImportFormatNumberForShortName( const OUString& rShortName ) { CacheVector::const_iterator aEnd; @@ -515,13 +504,6 @@ OUString FilterConfigCache::GetExportFormatExtension( sal_uInt16 nFormat, sal_In return OUString(""); } -OUString FilterConfigCache::GetExportFilterTypeName( sal_uInt16 nFormat ) -{ - if( nFormat < aExport.size() ) - return aExport[ nFormat ].sFilterType; - return OUString(""); -} - OUString FilterConfigCache::GetExportInternalFilterName( sal_uInt16 nFormat ) { if( nFormat < aExport.size() ) diff --git a/vcl/source/filter/FilterConfigCache.hxx b/vcl/source/filter/FilterConfigCache.hxx index f568c515b4f5..a5bfb641ff2b 100644 --- a/vcl/source/filter/FilterConfigCache.hxx +++ b/vcl/source/filter/FilterConfigCache.hxx @@ -85,7 +85,6 @@ public: sal_uInt16 GetImportFormatCount() const { return sal::static_int_cast< sal_uInt16 >(aImport.size()); }; sal_uInt16 GetImportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetImportFormatNumberForMediaType( const OUString& rMediaType ); sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName ); sal_uInt16 GetImportFormatNumberForTypeName( const OUString& rType ); sal_uInt16 GetImportFormatNumberForExtension( const OUString& rExt ); @@ -112,7 +111,6 @@ public: OUString GetExportFormatMediaType( sal_uInt16 nFormat ); OUString GetExportFormatShortName( sal_uInt16 nFormat ); OUString GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ); - OUString GetExportFilterTypeName( sal_uInt16 nFormat ); OUString GetExportInternalFilterName( sal_uInt16 nFormat ); bool IsExportInternalFilter( sal_uInt16 nFormat ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 73807d4e9306..7b763996890c 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1155,11 +1155,6 @@ sal_uInt16 GraphicFilter::GetImportFormatNumber( const OUString& rFormatName ) return pConfig->GetImportFormatNumber( rFormatName ); } -sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const OUString& rMediaType ) -{ - return pConfig->GetImportFormatNumberForMediaType( rMediaType ); -} - sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const OUString& rShortName ) { return pConfig->GetImportFormatNumberForShortName( rShortName ); @@ -1180,22 +1175,18 @@ OUString GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat ) return pConfig->GetImportFilterTypeName( nFormat ); } +#ifdef WNT OUString GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetImportFormatMediaType( nFormat ); } +#endif OUString GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat ) { return pConfig->GetImportFormatShortName( nFormat ); } -OUString GraphicFilter::GetImportOSFileType( sal_uInt16 ) -{ - OUString aOSFileType; - return aOSFileType; -} - OUString GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetImportWildcard( nFormat, nEntry ); @@ -1236,11 +1227,6 @@ OUString GraphicFilter::GetExportFormatName( sal_uInt16 nFormat ) return pConfig->GetExportFormatName( nFormat ); } -OUString GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat ) -{ - return pConfig->GetExportFilterTypeName( nFormat ); -} - OUString GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat ) { return pConfig->GetExportFormatMediaType( nFormat ); @@ -1251,12 +1237,6 @@ OUString GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat ) return pConfig->GetExportFormatShortName( nFormat ); } -OUString GraphicFilter::GetExportOSFileType( sal_uInt16 ) -{ - OUString aOSFileType; - return aOSFileType; -} - OUString GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry ) { return pConfig->GetExportWildcard( nFormat, nEntry ); diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 9917203f565a..87bc60f1be46 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -286,114 +286,6 @@ bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat ) return bRet; } -void BitmapReadAccess::ImplZeroInitUnusedBits() -{ - const sal_uInt32 nWidth = Width(), nHeight = Height(), nScanSize = GetScanlineSize(); - - if( nWidth && nHeight && nScanSize && GetBuffer() ) - { - sal_uInt32 nBits; - bool bMsb; - - const sal_uLong nScanlineFormat = GetScanlineFormat(); - switch( nScanlineFormat ) - { - case( BMP_FORMAT_1BIT_MSB_PAL ): - nBits = 1; - bMsb = true; - break; - - case( BMP_FORMAT_1BIT_LSB_PAL ): - nBits = 1; - bMsb = false; - break; - - case( BMP_FORMAT_4BIT_MSN_PAL ): - nBits = 4; - bMsb = true; - break; - - case( BMP_FORMAT_4BIT_LSN_PAL ): - nBits = 4; - bMsb = false; - break; - - case( BMP_FORMAT_8BIT_PAL ): - case( BMP_FORMAT_8BIT_TC_MASK ): - bMsb = true; - nBits = 8; - break; - - case( BMP_FORMAT_16BIT_TC_MSB_MASK ): - case( BMP_FORMAT_16BIT_TC_LSB_MASK ): - bMsb = true; - nBits = 16; - break; - - case( BMP_FORMAT_24BIT_TC_BGR ): - case( BMP_FORMAT_24BIT_TC_RGB ): - case( BMP_FORMAT_24BIT_TC_MASK ): - bMsb = true; - nBits = 24; - break; - - case( BMP_FORMAT_32BIT_TC_ABGR ): - case( BMP_FORMAT_32BIT_TC_ARGB ): - case( BMP_FORMAT_32BIT_TC_BGRA ): - case( BMP_FORMAT_32BIT_TC_RGBA ): - case( BMP_FORMAT_32BIT_TC_MASK ): - bMsb = true; - nBits = 32; - break; - - default: - { - OSL_FAIL( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format"); - nBits = 0; - bMsb = true; - } - break; - } - - nBits *= nWidth; - if( nScanSize % 4 || !bMsb ) - { - DBG_ASSERT( 8*nScanSize >= nBits, - "BitmapWriteAccess::ZeroInitUnusedBits: span size smaller than width?!"); - const sal_uInt32 nLeftOverBits = 8*sizeof(sal_uInt8)*nScanSize - nBits; - if( nLeftOverBits != 0 ) // else there is really nothing to do - { - const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; - sal_uInt8 nMask; - - if( bMsb ) - nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); - else - nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); - - sal_uInt8* pLastBytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - nBytes ); - for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) - { - *pLastBytes &= nMask; - for( sal_uInt32 j = 1; j < nBytes; j++ ) - pLastBytes[j] = 0; - } - } - } - else if( nBits & 0x1f ) - { - sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits ); - sal_uInt8* pLast4Bytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - 4 ); - -#ifdef OSL_LITENDIAN - nMask = OSL_SWAPDWORD( nMask ); -#endif - for( sal_uInt32 i = 0; i < nHeight; i++, pLast4Bytes += nScanSize ) - *reinterpret_cast<sal_uInt32*>(pLast4Bytes) &= nMask; - } - } -} - BitmapColor BitmapReadAccess::GetInterpolatedColorWithFallback( double fY, double fX, const BitmapColor& rFallback ) const { // ask directly doubles >= 0.0 here to avoid rounded values of 0 at small negative diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx index 3d13c82d07e6..d803813ac919 100644 --- a/vcl/source/gdi/cvtgrf.cxx +++ b/vcl/source/gdi/cvtgrf.cxx @@ -24,8 +24,7 @@ #include <svdata.hxx> // Callback -GraphicConverter::GraphicConverter() : - mpConvertData( NULL ) +GraphicConverter::GraphicConverter() { } diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx index 483cc3cc0ce9..d8e11f1e2caa 100644 --- a/xmloff/source/forms/elementimport.hxx +++ b/xmloff/source/forms/elementimport.hxx @@ -575,13 +575,13 @@ namespace xmloff // SvXMLImportContext overridables virtual SvXMLImportContext* CreateChildContext( sal_uInt16 _nPrefix, const OUString& _rLocalName, - const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); - virtual void EndElement(); + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE; + virtual void EndElement() SAL_OVERRIDE; protected: // OElementImport overridables virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > - createElement(); + createElement() SAL_OVERRIDE; // create the child context for the given control type virtual SvXMLImportContext* implCreateControlWrapper( @@ -609,7 +609,7 @@ namespace xmloff protected: // OElementImport overridables virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > - createElement(); + createElement() SAL_OVERRIDE; }; //= OColumnWrapperImport |