filter/source/xmlfilterdetect/filterdetect.cxx | 82 +------------------------ filter/source/xmlfilterdetect/filterdetect.hxx | 25 ------- svx/source/sidebar/text/TextPropertyPanel.cxx | 6 - 3 files changed, 7 insertions(+), 106 deletions(-)
New commits: commit e0be1a74444683f760d90f88cc3be14d9b377591 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Thu Apr 24 01:32:48 2014 +0300 Use the show method directly Change-Id: If4e11ae1fda86b612aeeed94b1cde4a5711c6359 diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index b381b7c..4486cfe 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -129,11 +129,7 @@ void TextPropertyPanel::HandleContextChange ( return; maContext = aContext; - - if (maContext.GetApplication_DI() == sfx2::sidebar::EnumContext::Application_Calc) - mpToolBoxIncDec->Hide(); - else - mpToolBoxIncDec->Show(); + mpToolBoxIncDec->Show(maContext.GetApplication_DI() != sfx2::sidebar::EnumContext::Application_Calc); bool bWriterText = false; switch (maContext.GetCombinedContext_DI()) commit 9dd8b943ba0d1b60ee4d76ec4a514f0b087b1398 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Tue Apr 22 23:11:52 2014 +0300 Remove unused code from xml detector Change-Id: I3f8910017f60dd61a186c29e48a4a082010b989a diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index 378d8fb..a6f0089 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -17,26 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <iostream> -#include <stdlib.h> -#include <ctype.h> -#include <stdio.h> -#include <cstring> #include "filterdetect.hxx" #include <osl/diagnose.h> -#include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#include <com/sun/star/xml/sax/InputSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> -#include <com/sun/star/xml/XImportFilter.hpp> -#include <com/sun/star/xml/XExportFilter.hpp> -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> -#include <com/sun/star/task/XStatusIndicatorFactory.hpp> -#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> -#include <com/sun/star/style/XStyleLoader.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -46,29 +29,6 @@ #include <unotools/ucbstreamhelper.hxx> #include <boost/scoped_ptr.hpp> -using com::sun::star::uno::Sequence; -using com::sun::star::uno::Reference; -using com::sun::star::uno::Any; -using com::sun::star::uno::UNO_QUERY; -using com::sun::star::uno::XComponentContext; -using com::sun::star::uno::XInterface; -using com::sun::star::uno::Exception; -using com::sun::star::uno::RuntimeException; -using com::sun::star::io::XActiveDataSource; -using com::sun::star::io::XOutputStream; -using com::sun::star::beans::PropertyValue; -using com::sun::star::document::XExporter; -using com::sun::star::document::XFilter; -using com::sun::star::document::XExtendedFilterDetection; - -using com::sun::star::io::XInputStream; -using com::sun::star::document::XImporter; -using com::sun::star::xml::sax::InputSource; -using com::sun::star::xml::sax::XDocumentHandler; -using com::sun::star::xml::sax::XParser; - -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star; using namespace com::sun::star::container; using namespace com::sun::star::uno; using namespace com::sun::star::beans; @@ -142,11 +102,11 @@ OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun: if ( nUniPos == 0 ) // No BOM detected, try to guess UTF-16 endianness { - sal_uInt16 sHeader = 0; - pInStream->ReadUInt16( sHeader ); - if ( sHeader == 0x003C ) + sal_uInt16 nHeader = 0; + pInStream->ReadUInt16( nHeader ); + if ( nHeader == 0x003C ) bTryUtf16 = true; - else if ( sHeader == 0x3C00 ) + else if ( nHeader == 0x3C00 ) { bTryUtf16 = true; pInStream->SetEndianSwap( !pInStream->IsEndianSwap() ); @@ -209,42 +169,11 @@ OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun: } // XInitialization - -void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments ) +void SAL_CALL FilterDetect::initialize( const Sequence< Any >& /*aArguments*/ ) throw (Exception, RuntimeException, std::exception) { - Sequence < PropertyValue > aAnySeq; - sal_Int32 nLength = aArguments.getLength(); - if ( nLength && ( aArguments[0] >>= aAnySeq ) ) - { - const PropertyValue * pValue = aAnySeq.getConstArray(); - nLength = aAnySeq.getLength(); - for ( sal_Int32 i = 0 ; i < nLength; i++) - { - - if ( pValue[i].Name == "Type" ) - { - pValue[i].Value >>= msFilterName; - - } - else if ( pValue[i].Name == "UserData" ) - { - - pValue[i].Value >>= msUserData; - - } - else if ( pValue[i].Name == "TemplateName" ) - { - - pValue[i].Value>>=msTemplateName; - } - - } - } } - - OUString FilterDetect_getImplementationName () { return OUString( "com.sun.star.comp.filters.XMLFilterDetect" ); @@ -268,6 +197,7 @@ OUString SAL_CALL FilterDetect::getImplementationName( ) { return FilterDetect_getImplementationName(); } + sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) throw (RuntimeException, std::exception) { diff --git a/filter/source/xmlfilterdetect/filterdetect.hxx b/filter/source/xmlfilterdetect/filterdetect.hxx index 72c0fe5..3baa39f 100644 --- a/filter/source/xmlfilterdetect/filterdetect.hxx +++ b/filter/source/xmlfilterdetect/filterdetect.hxx @@ -20,10 +20,7 @@ #ifndef INCLUDED_FILTER_SOURCE_XMLFILTERDETECT_FILTERDETECT_HXX #define INCLUDED_FILTER_SOURCE_XMLFILTERDETECT_FILTERDETECT_HXX -#include <com/sun/star/document/XFilter.hpp> -#include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XExtendedFilterDetection.hpp> -#include <com/sun/star/document/XImporter.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase3.hxx> @@ -32,16 +29,6 @@ namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } -enum FilterType -{ - FILTER_IMPORT, - FILTER_EXPORT -}; - -/* This component will be instantiated for both import or export. Whether it calls - * setSourceDocument or setTargetDocument determines which Impl function the filter - * member calls */ - class FilterDetect : public cppu::WeakImplHelper3 < css::document::XExtendedFilterDetection, css::lang::XInitialization, @@ -51,18 +38,6 @@ class FilterDetect : public cppu::WeakImplHelper3 < protected: css::uno::Reference< css::uno::XComponentContext > mxCtx; - css::uno::Reference< css::lang::XComponent > mxDoc; - - OUString msFilterName; - OUString msTemplateName; - - css::uno::Sequence< OUString > msUserData; - - bool SAL_CALL exportImpl( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ) - throw (css::uno::RuntimeException); - - bool SAL_CALL importImpl( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor ) - throw (css::uno::RuntimeException); public: FilterDetect( const css::uno::Reference< css::uno::XComponentContext > &rxCtx) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits