[Libreoffice-commits] core.git: 9 commits - comphelper/source cui/source desktop/source onlineupdate/source reportdesign/source sfx2/source store/source svx/source sw/source unodevtools/source writerfilter/source

Caolán McNamara caolanm at redhat.com
Mon Aug 10 04:18:23 PDT 2015


 comphelper/source/misc/types.cxx                      |    4 --
 cui/source/dialogs/iconcdlg.cxx                       |    6 +---
 cui/source/options/optgenrl.cxx                       |    6 ----
 cui/source/options/optlingu.cxx                       |    6 ----
 cui/source/options/optsave.cxx                        |   18 +++++-------
 cui/source/tabpages/backgrnd.cxx                      |   10 +++----
 cui/source/tabpages/border.cxx                        |    4 +-
 desktop/source/deployment/manager/dp_manager.cxx      |    4 +-
 onlineupdate/source/libmar/sign/nss_secutil.c         |    2 -
 onlineupdate/source/libmar/tool/mar.c                 |    1 
 reportdesign/source/filter/xml/xmlExport.cxx          |    4 --
 sfx2/source/dialog/tabdlg.cxx                         |    6 ++--
 store/source/store.cxx                                |    2 -
 svx/source/form/fmtextcontrolshell.cxx                |    4 +-
 sw/source/filter/xml/wrtxml.cxx                       |   25 ++++++++----------
 sw/source/filter/xml/xmltexte.cxx                     |    3 --
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |    2 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx     |    2 -
 18 files changed, 44 insertions(+), 65 deletions(-)

New commits:
commit 52be3fcbd960238b717a6487f0e19156825c8159
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 10 12:00:34 2015 +0100

    cppcheck: badBitmaskCheck
    
    Change-Id: I0a6787379317e5077c5a4520e5144fe091a01538

diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index bf90a98..da60498 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -820,7 +820,7 @@ short IconChoiceDialog::Ok()
 
                 if ( pPage->FillItemSet( &aTmp ) )
                 {
-                    _bModified |= true;
+                    _bModified = true;
                     pExampleSet->Put( aTmp );
                     pOutSet->Put( aTmp );
                 }
@@ -829,13 +829,11 @@ short IconChoiceDialog::Ok()
     }
 
     if ( _bModified || ( pOutSet && pOutSet->Count() > 0 ) )
-        _bModified |= true;
+        _bModified = true;
 
     return _bModified ? RET_OK : RET_CANCEL;
 }
 
-
-
 void IconChoiceDialog::FocusOnIcon( sal_uInt16 nId )
 {
     // set focus to icon for the current visible page
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 824447b..a179917 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -306,8 +306,6 @@ VclPtr<SfxTabPage> SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxIte
     return VclPtr<SvxGeneralTabPage>::Create( pParent, *rAttrSet );
 }
 
-
-
 bool SvxGeneralTabPage::FillItemSet( SfxItemSet* )
 {
     // remove leading and trailing whitespaces
@@ -320,13 +318,11 @@ bool SvxGeneralTabPage::FillItemSet( SfxItemSet* )
     if ( m_pUseDataCB->IsChecked() != aSaveOpt.IsUseUserData() )
     {
         aSaveOpt.SetUseUserData( m_pUseDataCB->IsChecked() );
-        bModified |= true;
+        bModified = true;
     }
     return bModified;
 }
 
-
-
 void SvxGeneralTabPage::Reset( const SfxItemSet* rSet )
 {
     SetAddress_Impl();
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index d4d9f1b..5a68179 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1156,8 +1156,6 @@ VclPtr<SfxTabPage> SvxLinguTabPage::Create( vcl::Window* pParent,
     return VclPtr<SvxLinguTabPage>::Create( pParent, *rAttrSet );
 }
 
-
-
 bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
 {
     bool bModified = true; // !!!!
@@ -1315,14 +1313,12 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
     {
         rCoreSet->Put( SfxBoolItem( GetWhich( SID_AUTOSPELL_CHECK ),
                                 bNewAutoCheck ) );
-        bModified |= true;
+        bModified = true;
     }
 
     return bModified;
 }
 
-
-
 sal_uLong SvxLinguTabPage::GetDicUserData( const uno::Reference< XDictionary > &rxDic, sal_uInt16 nIdx )
 {
     sal_uLong nRes = 0;
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index c617d64..2c049a5 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -280,55 +280,55 @@ bool SfxSaveTabPage::FillItemSet( SfxItemSet* rSet )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_DOCINFO ),
                                aDocInfoCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     if ( aBackupCB->IsEnabled() && aBackupCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_BACKUP ),
                                aBackupCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     if ( aAutoSaveCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_AUTOSAVE ),
                                aAutoSaveCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
     if ( aWarnAlienFormatCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_WARNALIENFORMAT ),
                                aWarnAlienFormatCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     if ( aAutoSaveEdit->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxUInt16Item( GetWhich( SID_ATTR_AUTOSAVEMINUTE ),
                                  (sal_uInt16)aAutoSaveEdit->GetValue() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     if ( aUserAutoSaveCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_USERAUTOSAVE ),
                                aUserAutoSaveCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
     // save relatively
     if ( aRelativeFsysCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_FSYS ),
                                aRelativeFsysCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     if ( aRelativeInetCB->IsValueChangedFromSaved() )
     {
         rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_INET ),
                                aRelativeInetCB->IsChecked() ) );
-        bModified |= true;
+        bModified = true;
     }
 
     SvtModuleOptions aModuleOpt;
@@ -363,8 +363,6 @@ bool SfxSaveTabPage::FillItemSet( SfxItemSet* rSet )
     return bModified;
 }
 
-
-
 bool isODFFormat( const OUString& sFilter )
 {
     static const char* aODFFormats[] =
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 51fbd30..70b602d 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -797,7 +797,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
             if ( *pTableBck_Impl->pCellBrush != *pOldCell )
             {
                 rCoreSet->Put( *pTableBck_Impl->pCellBrush );
-                bModified |= true;
+                bModified = true;
             }
         }
 
@@ -809,7 +809,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
             if ( *pTableBck_Impl->pRowBrush != *pOldRow )
             {
                 rCoreSet->Put( *pTableBck_Impl->pRowBrush );
-                bModified |= true;
+                bModified = true;
             }
         }
 
@@ -821,7 +821,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
             if ( *pTableBck_Impl->pTableBrush != *pOldTable )
             {
                 rCoreSet->Put( *pTableBck_Impl->pTableBrush );
-                bModified |= true;
+                bModified = true;
             }
         }
 
@@ -829,7 +829,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
         {
             rCoreSet->Put( SfxUInt16Item( SID_BACKGRND_DESTINATION,
                                          m_pTblLBox->GetSelectEntryPos() ) );
-            bModified |= true;
+            bModified = true;
         }
     }
     else if( bHighlighting )
@@ -842,7 +842,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
                 (*pHighlighting != *pOldChar || *pHighlighting != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
             {
                 rCoreSet->Put( *pHighlighting );
-                bModified |= true;
+                bModified = true;
             }
         }
     }
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 3daf13f..f61e89b 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -742,14 +742,14 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
         if ( !pOldBoxItem || !( *pOldBoxItem == aBoxItem ) )
         {
             rCoreAttrs->Put( aBoxItem );
-            bAttrsChanged |= true;
+            bAttrsChanged = true;
         }
         const SfxPoolItem* pOld = GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER, false );
 
         if ( !pOld || !( *static_cast<const SvxBoxInfoItem*>(pOld) == aBoxInfoItem ) )
         {
             rCoreAttrs->Put( aBoxInfoItem );
-            bAttrsChanged |= true;
+            bAttrsChanged = true;
         }
     }
     else
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index d67f496..d75cb37 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1268,7 +1268,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions(
                 xPackage->revokePackage(true, xAbortChannel, xCmdEnv);
                 removePackage(xPackage->getIdentifier().Value, xPackage->getName(),
                               xAbortChannel, xCmdEnv);
-                bModified |= true;
+                bModified = true;
             }
         }
         catch( const uno::Exception & e )
@@ -1404,7 +1404,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
                     //try to install the extension again.
                     dbData.failedPrerequisites = OUString::number(failedPrereq);
                     insertToActivationLayerDB(id, dbData);
-                    bModified |= true;
+                    bModified = true;
                 }
             }
         }
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9435f9a..2b71116 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -843,7 +843,7 @@ short SfxTabDialog::Ok()
 
                 if ( pTabPage->FillItemSet( &aTmp ) )
                 {
-                    bModified |= true;
+                    bModified = true;
                     if (pExampleSet)
                         pExampleSet->Put( aTmp );
                     pOutSet->Put( aTmp );
@@ -853,10 +853,10 @@ short SfxTabDialog::Ok()
     }
 
     if ( pImpl->bModified || ( pOutSet && pOutSet->Count() > 0 ) )
-        bModified |= true;
+        bModified = true;
 
     if (bStandardPushed)
-        bModified |= true;
+        bModified = true;
     return bModified ? RET_OK : RET_CANCEL;
 }
 
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 62a07c8..e90f74b 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -977,7 +977,7 @@ namespace svx
                         bDisable |= !aDataHelper.HasFormat( SotClipboardFormatId::STRING );
                     }
                     else
-                        bDisable |= true;
+                        bDisable = true;
 
                     bNeedTextComponent = true;
                     bNeedWriteableControl = true;
@@ -995,7 +995,7 @@ namespace svx
 
                 default:
                     // slot is unknown at all
-                    bDisable |= true;
+                    bDisable = true;
                     break;
                 }
                 SAL_WARN_IF( bNeedSelection && !bNeedTextComponent, "svx.form", "FmTextControlShell::GetTextAttributeState: bNeedSelection should imply bNeedTextComponent!" );
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 4ba2e99..5679163 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -206,7 +206,7 @@ bool checkAttribute(
     {
         if (attribute & attributes[i]) {
             if (!attributeValue.isEmpty()) {
-                cast |= true;
+                cast = true;
                 attributeValue.append("|");
             }
             switch (attributes[i])
commit eab0ae6a51667962dff04a0f1ed2b8411a344462
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:30:36 2015 +0100

    cppcheck: nullPointerRedundantCheck
    
    Change-Id: I5cac2cdb383de5448383434a910eb97061c29071

diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx
index 7ece3eb..9dc225f 100644
--- a/comphelper/source/misc/types.cxx
+++ b/comphelper/source/misc/types.cxx
@@ -461,9 +461,7 @@ Type getSequenceElementType(const Type& _rSequenceType)
     typelib_IndirectTypeDescription* pSequenceTD =
         reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get());
 
-    OSL_ASSERT(pSequenceTD);
-    OSL_ASSERT(pSequenceTD->pType);
-
+    OSL_ASSERT(pSequenceTD && pSequenceTD->pType);
     if (pSequenceTD && pSequenceTD->pType)
         return Type(pSequenceTD->pType);
 
commit f84b07c57185fee4ad5f1f9a6276c7a9db54e00a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:27:12 2015 +0100

    cppcheck: variableScope
    
    Change-Id: I41270ad017dd16567c9b68df6044f182eec0b4ce

diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 5f6e9e7..26c2551 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -905,17 +905,15 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection)
                             {
                             }
 
-                            bool bPageSet = false;
                             if ( bExportData )
                             {
-                                bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
+                                const bool bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
                                 if ( bPageSet )
                                     eToken = XML_FIXED_CONTENT;
                                 else if ( eToken == XML_IMAGE )
                                     AddAttribute(XML_NAMESPACE_REPORT, XML_PRESERVE_IRI, xImage->getPreserveIRI() ? XML_TRUE : XML_FALSE );
                             }
 
-                            //if ( !bPageSet )
                             {
                                 // start <report:eToken>
                                 SvXMLElementExport aComponents(*this,XML_NAMESPACE_REPORT, eToken, false, false);
commit f2ca8ff2e68281abf6b1d805f9fd17bf0d4e7750
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:17:25 2015 +0100

    cppcheck: knownConditionTrueFalse
    
    Change-Id: I0368639742e23ce449d2d4ba75f524e693d2ea65

diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 9c35e39..9e661d6 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -266,7 +266,7 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
     }
 
     // export sub streams for package, else full stream into a file
-    bool bWarn = false, bErr = false;
+    bool bWarn = false;
 
     // RDF metadata: export if ODF >= 1.2
     // N.B.: embedded documents have their own manifest.rdf!
@@ -327,25 +327,24 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
         }
     }
 
-    if( !bErr )
+    if( !bBlock )
     {
-        if( !bBlock )
+        if( !WriteThroughComponent(
+            xModelComp, "settings.xml", xContext,
+            (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
+                    : "com.sun.star.comp.Writer.XMLSettingsExporter"),
+            aEmptyArgs, aProps ) )
         {
-            if( !WriteThroughComponent(
-                xModelComp, "settings.xml", xContext,
-                (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
-                        : "com.sun.star.comp.Writer.XMLSettingsExporter"),
-                aEmptyArgs, aProps ) )
+            if( !bWarn )
             {
-                if( !bWarn )
-                {
-                    bWarn = true;
-                    sWarnFile = "settings.xml";
-                }
+                bWarn = true;
+                sWarnFile = "settings.xml";
             }
         }
     }
 
+    bool bErr = false;
+
     OUString sErrFile;
     if( !WriteThroughComponent(
             xModelComp, "styles.xml", xContext,
commit 802adf5563d3fb190b7ce964bc10a3792f99ad04
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:16:12 2015 +0100

    cppcheck: uselessAssignmentPtrArg
    
    Change-Id: I0b09092b7063b959a9b32ee276c7ae8f8cbb6abc

diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index aaae935..3cfb48d 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -215,7 +215,6 @@ static void lcl_addAspect(
         if ( nAspect )
         {
             *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_DRAW_ASPECT ), uno::makeAny( nAspect ) );
-            pStates++;
         }
     }
 }
@@ -246,7 +245,6 @@ static void lcl_addOutplaceProperties(
 
             aAny <<= (sal_Int32)aSize.Height();
             *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), aAny );
-            pStates++;
         }
     }
 }
@@ -317,7 +315,6 @@ static void lcl_addFrameProperties(
         Any aAny2;
         aAny <<= nHeight;
         *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_VERT ), aAny2 );
-        pStates++;
     }
 }
 
commit cb164b1d115cb848abfba934d44a4d41ff84c6fe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:12:35 2015 +0100

    cppcheck: arrayIndexThenCheck
    
    Change-Id: I66dc4dd095d4e1a9d963b1c2c6a99b16d9f9bf61

diff --git a/onlineupdate/source/libmar/sign/nss_secutil.c b/onlineupdate/source/libmar/sign/nss_secutil.c
index ac8954c..01aa573 100644
--- a/onlineupdate/source/libmar/sign/nss_secutil.c
+++ b/onlineupdate/source/libmar/sign/nss_secutil.c
@@ -158,7 +158,7 @@ SECU_FilePasswd(PK11SlotInfo *slot, PRBool retry, void *arg)
     int phraseLen;
 
     /* handle the Windows EOL case */
-    while (phrases[i] != '\r' && phrases[i] != '\n' && i < nb) i++;
+    while (i < nb && phrases[i] != '\r' && phrases[i] != '\n') i++;
     /* terminate passphrase */
     phrases[i++] = '\0';
     /* clean up any EOL before the start of the next passphrase */
commit 85e14be20f1ba961ee5f5014a845e044ce8db39b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 13:09:22 2015 +0100

    cppcheck: redundantPointerOp
    
    Change-Id: I0101893f5e8b65fb473a321e6169c3b610b33e60

diff --git a/store/source/store.cxx b/store/source/store.cxx
index 04b9cc1..a7c9875 100644
--- a/store/source/store.cxx
+++ b/store/source/store.cxx
@@ -164,7 +164,7 @@ storeError SAL_CALL store_openFile (
 
     xManager->acquire();
 
-    *phFile = static_cast<storeFileHandle>(&(*xManager));
+    *phFile = xManager.get();
     return store_E_None;
 }
 
commit 058c924c9385d003eefa728be7b23b2effd73913
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 12:47:03 2015 +0100

    cppcheck: unusedVariable
    
    Change-Id: I11e9a952fdb401e08d6095fc36f0eb2dba6e2917

diff --git a/onlineupdate/source/libmar/tool/mar.c b/onlineupdate/source/libmar/tool/mar.c
index d14690f..0cf0d9c 100644
--- a/onlineupdate/source/libmar/tool/mar.c
+++ b/onlineupdate/source/libmar/tool/mar.c
@@ -124,7 +124,6 @@ int main(int argc, char **argv) {
   const char *certNames[MAX_SIGNATURES];
   char *MARChannelID = MAR_CHANNEL_ID;
   char *productVersion = MOZ_APP_VERSION;
-  uint32_t k;
   int rv = -1;
   uint32_t certCount = 0;
   int32_t sigIndex = -1;
commit 758b5173993bc782e0759fb4db81bd9696e4b546
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 9 12:43:00 2015 +0100

    cppcheck: zerodiv
    
    Change-Id: Iaf327051d59c39cbd61e1a64bdf1ee5af5cc4f3b

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ad96b2d..3f0e6a3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3670,7 +3670,7 @@ void DomainMapper_Impl::CloseFieldCommand()
                                         PropertyMapPtr pCharContext = GetTopContext();
                                         // dHeight is the font size of the current style.
                                         double dHeight = 0;
-                                        if (GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight)
+                                        if ((GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight) && dHeight != 0)
                                             // Character escapement should be given in negative percents for subscripts.
                                             pCharContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( sal_Int16(- 100 * nDown / dHeight) ) );
                                         appendTextPortion(aContent, pCharContext);


More information about the Libreoffice-commits mailing list