sw/source/filter/ww8/ww8atr.cxx |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 41a9f54e5982f2e8a7ef53ed9be0b79e15ee9ebc
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Apr 16 10:50:20 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Apr 16 14:13:28 2025 +0200

    try to make the Windows build happy
    
    sw\sourceilter\ww8\ww8atr.cxx(350) : warning C4701: potentially 
uninitialized local variable 'pLRItem' used
    sw\sourceilter\ww8\ww8atr.cxx(350) : warning C4703: potentially 
uninitialized local pointer variable 'pLRItem' used
    
    Change-Id: Iab0c8219ae8bb27706e8a0286716b586fc933330
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184257
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2ebf13ce4a97..88fe95268778 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -341,20 +341,19 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& 
rSet, bool bPapFormat, b
         AttrOutput().OutputItem( *pRuleItem );
 
         // switch off the numbering?
-        const SfxPoolItem* pLRItem;
         if ( pRuleItem->GetValue().isEmpty() &&
-             SfxItemState::SET != rSet.GetItemState(RES_MARGIN_FIRSTLINE, 
false) &&
-             (pLRItem = rSet.GetItemIfSet(RES_MARGIN_FIRSTLINE)) )
+             SfxItemState::SET != rSet.GetItemState(RES_MARGIN_FIRSTLINE, 
false))
         {
-            // set the LR-Space of the parentformat!
-            AttrOutput().OutputItem( *pLRItem );
+            if (auto pLRItem = rSet.GetItemIfSet(RES_MARGIN_FIRSTLINE))
+                // set the LR-Space of the parentformat!
+                AttrOutput().OutputItem( *pLRItem );
         }
         if ( pRuleItem->GetValue().isEmpty() &&
-             SfxItemState::SET != rSet.GetItemState(RES_MARGIN_TEXTLEFT, 
false) &&
-             (pLRItem = rSet.GetItemIfSet(RES_MARGIN_TEXTLEFT)) )
+             SfxItemState::SET != rSet.GetItemState(RES_MARGIN_TEXTLEFT, 
false))
         {
-            // set the LR-Space of the parentformat!
-            AttrOutput().OutputItem( *pLRItem );
+             if (auto pLRItem = rSet.GetItemIfSet(RES_MARGIN_TEXTLEFT))
+                // set the LR-Space of the parentformat!
+                AttrOutput().OutputItem( *pLRItem );
         }
     }
 

Reply via email to