[Libreoffice-commits] core.git: writerfilter/source xmlsecurity/source

Noel Grandin noel at peralex.com
Mon Jun 27 07:58:13 UTC 2016


 writerfilter/source/dmapper/BorderHandler.cxx            |    3 -
 writerfilter/source/dmapper/BorderHandler.hxx            |    1 
 writerfilter/source/dmapper/DomainMapper.cxx             |    3 -
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |    3 -
 writerfilter/source/dmapper/DomainMapperTableManager.hxx |    1 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |   17 --------
 writerfilter/source/dmapper/DomainMapper_Impl.hxx        |    1 
 writerfilter/source/dmapper/GraphicImport.cxx            |    4 --
 writerfilter/source/dmapper/NumberingManager.cxx         |   29 +++------------
 writerfilter/source/dmapper/NumberingManager.hxx         |    1 
 writerfilter/source/dmapper/PropertyMap.cxx              |   10 +----
 writerfilter/source/dmapper/PropertyMap.hxx              |    7 ---
 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx   |    6 +--
 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx   |    1 
 14 files changed, 15 insertions(+), 72 deletions(-)

New commits:
commit a25327e4b18768e40c6044c86ce09136cfc23c10
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jun 27 09:03:38 2016 +0200

    loplugin:singlevalfields in writerfilter and xmlsec
    
    Change-Id: I51305ce4a6929b36f41eb7c7c83606ca8c5c89b8
    Reviewed-on: https://gerrit.libreoffice.org/26691
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 38fd788..80cc838 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -34,7 +34,6 @@ using namespace ::com::sun::star;
 
 BorderHandler::BorderHandler( bool bOOXML ) :
 LoggedProperties("BorderHandler"),
-m_nCurrentBorderPosition( BORDER_TOP ),
 m_nLineWidth(15), // Word default, in twips
 m_nLineType(0),
 m_nLineColor(0),
@@ -167,7 +166,7 @@ PropertyMapPtr  BorderHandler::getProperties()
     };
     PropertyMapPtr pPropertyMap(new PropertyMap);
     // don't fill in default properties
-    if( m_bOOXML || m_nCurrentBorderPosition )
+    if( m_bOOXML )
     {
         for( sal_Int32 nProp = 0; nProp < BORDER_COUNT; ++nProp)
         {
diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx
index ae9736a..6ea1e33 100644
--- a/writerfilter/source/dmapper/BorderHandler.hxx
+++ b/writerfilter/source/dmapper/BorderHandler.hxx
@@ -45,7 +45,6 @@ public:
     };
 
 private:
-    sal_Int8        m_nCurrentBorderPosition;
     //values of the current border
     sal_Int32       m_nLineWidth;
     sal_Int32       m_nLineType;
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b7403ea..36c5bfe 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3272,8 +3272,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
 
             if( pContext && pContext->GetFootnote().is() )
             {
-                if( !pContext->GetFootnoteSymbol() )
-                    pContext->GetFootnote()->setLabel( sText );
+                pContext->GetFootnote()->setLabel( sText );
                 //otherwise ignore sText
             }
             else if( m_pImpl->IsOpenFieldCommand() )
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index b558afd..ef71cdc 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -57,7 +57,6 @@ DomainMapperTableManager::DomainMapperTableManager() :
     m_bHasBtlrCell(false),
     m_bTableSizeTypeInserted(false),
     m_nLayoutType(0),
-    m_nMaxFixedWidth(0),
     m_pTablePropsHandler(new TablePropertiesHandler())
 {
     m_pTablePropsHandler->SetTableManager( this );
@@ -454,7 +453,6 @@ void DomainMapperTableManager::startLevel( )
     m_nCell.push_back( 0 );
     m_nTableWidth = 0;
     m_nLayoutType = 0;
-    m_nMaxFixedWidth = 0;
 
     // And push it back to the right level.
     if (oCurrentWidth)
@@ -478,7 +476,6 @@ void DomainMapperTableManager::endLevel( )
     m_nCell.pop_back( );
     m_nTableWidth = 0;
     m_nLayoutType = 0;
-    m_nMaxFixedWidth = 0;
 
     m_aTmpPosition.pop_back( );
     m_aTmpTableProperties.pop_back( );
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index 21e9809..c4e8d63 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -71,7 +71,6 @@ class DomainMapperTableManager : public TableManager
     bool m_bTableSizeTypeInserted;
     /// Table layout algorithm, IOW if we should consider fixed column width or not.
     sal_uInt32 m_nLayoutType;
-    sal_Int32 m_nMaxFixedWidth;
 
     std::unique_ptr<TablePropertiesHandler> m_pTablePropsHandler;
     PropertyMapPtr            m_pStyleProps;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5450f1d..f57c3d3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -200,7 +200,6 @@ DomainMapper_Impl::DomainMapper_Impl(
         m_bTextInserted(false),
         m_pLastSectionContext( ),
         m_pLastCharacterContext(),
-        m_nCurrentTabStopIndex( 0 ),
         m_sCurrentParaStyleId(),
         m_bInStyleSheetImport( false ),
         m_bInAnyTableImport( false ),
@@ -613,7 +612,6 @@ uno::Sequence< style::TabStop > DomainMapper_Impl::GetCurrentTabStopAndClear()
             aRet.push_back(rStop);
     }
     m_aCurrentTabStops.clear();
-    m_nCurrentTabStopIndex = 0;
     return comphelper::containerToSequence(aRet);
 }
 
@@ -1580,22 +1578,9 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
             uno::UNO_QUERY_THROW );
         uno::Reference< text::XFootnote > xFootnote( xFootnoteText, uno::UNO_QUERY_THROW );
         pTopContext->SetFootnote( xFootnote );
-        if( pTopContext->GetFootnoteSymbol() != 0)
-        {
-            xFootnote->setLabel( OUString( pTopContext->GetFootnoteSymbol() ) );
-        }
         FontTablePtr pFontTable = GetFontTable();
         uno::Sequence< beans::PropertyValue > aFontProperties;
-        if( pFontTable && pTopContext->GetFootnoteFontId() >= 0 && pFontTable->size() > (size_t)pTopContext->GetFootnoteFontId() )
-        {
-            const FontEntry::Pointer_t pFontEntry(pFontTable->getFontEntry(sal_uInt32(pTopContext->GetFootnoteFontId())));
-            PropertyMapPtr aFontProps( new PropertyMap );
-            aFontProps->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( pFontEntry->sFontName  ));
-            aFontProps->Insert(PROP_CHAR_FONT_CHAR_SET, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding  ));
-            aFontProps->Insert(PROP_CHAR_FONT_PITCH, uno::makeAny( pFontEntry->nPitchRequest  ));
-            aFontProperties = aFontProps->GetPropertyValues();
-        }
-        else if(!pTopContext->GetFootnoteFontName().isEmpty())
+        if(!pTopContext->GetFootnoteFontName().isEmpty())
         {
             PropertyMapPtr aFontProps( new PropertyMap );
             aFontProps->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( pTopContext->GetFootnoteFontName()  ));
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 4567e62..896f7e1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -404,7 +404,6 @@ private:
     PropertyMapPtr           m_pLastCharacterContext;
 
     ::std::vector<DeletableTabStop> m_aCurrentTabStops;
-    sal_uInt32                      m_nCurrentTabStopIndex;
     OUString                 m_sCurrentParaStyleId;
     bool                            m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
     bool                            m_bInAnyTableImport; //in import of fonts, styles, lists or lfos
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 79b46c7..0592d56 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -238,7 +238,6 @@ public:
     sal_Int32           nCurrentBorderLine;
 
     bool            bIsGraphic;
-    bool            bIsBitmap;
 
     bool            bHoriFlip;
     bool            bVertFlip;
@@ -299,7 +298,6 @@ public:
         ,eColorMode( drawing::ColorMode_STANDARD )
         ,nCurrentBorderLine(BORDER_TOP)
         ,bIsGraphic(false)
-        ,bIsBitmap(false)
         ,bHoriFlip(false)
         ,bVertFlip(false)
         ,bSizeProtected(false)
@@ -1367,7 +1365,7 @@ void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Referen
         beans::PropertyValues aMediaProperties( 1 );
         aMediaProperties[0].Name = getPropertyName(PROP_INPUT_STREAM);
 
-        uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len, m_pImpl->bIsBitmap );
+        uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len, false/*bIsBitmap*/ );
         aMediaProperties[0].Value <<= xIStream;
 
         uno::Reference<beans::XPropertySet> xPropertySet;
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 0cbd6db..a56c98a 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -667,7 +667,6 @@ ListsManager::ListsManager(DomainMapper& rDMapper,
     , LoggedTable("ListsManager")
     , m_rDMapper(rDMapper)
     , m_xFactory(xFactory)
-    , m_bIsLFOImport(false)
 {
 }
 
@@ -1085,27 +1084,13 @@ void ListsManager::lcl_entry( int /* pos */,
     }
     else
     {
-        if ( m_bIsLFOImport )
-        {
-            // Create ListDef's
-            OSL_ENSURE( !m_pCurrentDefinition.get(), "current entry has to be NULL here");
-            ListDef::Pointer pList( new ListDef() );
-            m_pCurrentDefinition = pList;
-            ref->resolve(*this);
-            //append it to the table
-            m_aLists.push_back( pList );
-            m_pCurrentDefinition = AbstractListDef::Pointer();
-        }
-        else
-        {
-            // Create AbstractListDef's
-            OSL_ENSURE( !m_pCurrentDefinition.get(), "current entry has to be NULL here");
-            m_pCurrentDefinition.reset( new AbstractListDef( ) );
-            ref->resolve(*this);
-            //append it to the table
-            m_aAbstractLists.push_back( m_pCurrentDefinition );
-            m_pCurrentDefinition = AbstractListDef::Pointer();
-        }
+        // Create AbstractListDef's
+        OSL_ENSURE( !m_pCurrentDefinition.get(), "current entry has to be NULL here");
+        m_pCurrentDefinition.reset( new AbstractListDef( ) );
+        ref->resolve(*this);
+        //append it to the table
+        m_aAbstractLists.push_back( m_pCurrentDefinition );
+        m_pCurrentDefinition = AbstractListDef::Pointer();
     }
 }
 
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index 19d8e11..f189041 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -215,7 +215,6 @@ private:
     // These members are used for import only
     AbstractListDef::Pointer                            m_pCurrentDefinition;
     NumPicBullet::Pointer                               m_pCurrentNumPicBullet;
-    bool                                                m_bIsLFOImport;
 
     AbstractListDef::Pointer    GetAbstractList( sal_Int32 nId );
 
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 31001c1..b31dbb0 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -54,9 +54,7 @@ namespace writerfilter {
 namespace dmapper{
 
 
-PropertyMap::PropertyMap() :
-    m_cFootnoteSymbol( 0 ),
-    m_nFootnoteFontId( -1 )
+PropertyMap::PropertyMap()
 {
 }
 
@@ -416,7 +414,6 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
     ,m_nHeaderTop( 1270 ) //720 twip
     ,m_nHeaderBottom( 1270 )//720 twip
     ,m_nDzaGutter( 0 )
-    ,m_bGutterRTL( false )
     ,m_nGridType(0)
     ,m_nGridLinePitch( 1 )
     ,m_nDxtCharSpace( 0 )
@@ -1019,10 +1016,7 @@ void SectionPropertyMap::HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl)
     if( m_nDzaGutter > 0 )
     {
         //todo: iGutterPos from DocProperties are missing
-        if( m_bGutterRTL )
-            m_nRightMargin += m_nDzaGutter;
-        else
-            m_nLeftMargin += m_nDzaGutter;
+        m_nLeftMargin += m_nDzaGutter;
     }
     Insert(PROP_LEFT_MARGIN, uno::makeAny( m_nLeftMargin  ));
     Insert(PROP_RIGHT_MARGIN, uno::makeAny( m_nRightMargin ));
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 53b8f66..5daf4e8 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -111,8 +111,6 @@ class PropertyMap
 
     //marks context as footnote context - ::text( ) events contain either the footnote character or can be ignored
     //depending on sprmCSymbol
-    sal_Unicode                                                                 m_cFootnoteSymbol; // 0 == invalid
-    sal_Int32                                                                   m_nFootnoteFontId; // negative values are invalid ids
     OUString                                                             m_sFootnoteFontName;
     css::uno::Reference<css::text::XFootnote> m_xFootnote;
 
@@ -156,10 +154,6 @@ public:
     const css::uno::Reference<css::text::XFootnote>& GetFootnote() const { return m_xFootnote; }
     void SetFootnote(css::uno::Reference<css::text::XFootnote> const& xF) { m_xFootnote = xF; }
 
-    sal_Unicode GetFootnoteSymbol() const { return m_cFootnoteSymbol;}
-
-    sal_Int32   GetFootnoteFontId() const { return m_nFootnoteFontId;}
-
     const OUString&      GetFootnoteFontName() const { return m_sFootnoteFontName;}
 
     virtual void insertTableProperties( const PropertyMap* );
@@ -223,7 +217,6 @@ class SectionPropertyMap : public PropertyMap
     sal_Int32                               m_nHeaderBottom;
 
     sal_Int32                               m_nDzaGutter;
-    bool                                    m_bGutterRTL;
 
     sal_Int32                               m_nGridType;
     sal_Int32                               m_nGridLinePitch;
diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
index 49ff9c7..f322842 100644
--- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
@@ -39,9 +39,7 @@ using namespace ::com::sun::star::security ;
 using ::com::sun::star::security::XCertificateExtension ;
 
 
-SanExtensionImpl::SanExtensionImpl() :
-m_critical( false )
-{
+SanExtensionImpl::SanExtensionImpl() {
 }
 
 SanExtensionImpl::~SanExtensionImpl() {
@@ -50,7 +48,7 @@ SanExtensionImpl::~SanExtensionImpl() {
 
 //Methods from XCertificateExtension
 sal_Bool SAL_CALL SanExtensionImpl::isCritical() throw( css::uno::RuntimeException, std::exception ) {
-    return m_critical ;
+    return false;
 }
 
 css::uno::Sequence< sal_Int8 > SAL_CALL SanExtensionImpl::getExtensionId() throw( css::uno::RuntimeException, std::exception ) {
diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx
index dfbe91f..ff6f87e 100644
--- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx
+++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx
@@ -34,7 +34,6 @@ class SanExtensionImpl : public ::cppu::WeakImplHelper<
     css::security::XSanExtension >
 {
     private:
-        bool m_critical ;
         css::uno::Sequence< sal_Int8 > m_xExtnId ;
         css::uno::Sequence< sal_Int8 > m_xExtnValue ;
         css::uno::Sequence< css::security::CertAltNameEntry > m_Entries;


More information about the Libreoffice-commits mailing list