Commits

Anonymous committed 49f39c3

sw34bf04: #i51277#: MSWordExportBase::OutputTextNode:
for AUTOFMT that ends at para end, with frame also anchored at para end.
the formatting was not exported properly.
so move the OutAttr call before the OutFlys call, except if para is empty.

  • Participants
  • Parent commits b10cb57

Comments (0)

Files changed (1)

File sw/source/filter/ww8/wrtw8nds.cxx

                         : nSwPos == *pHt->GetStart() )
             {
                 sal_uInt16 nWhich = pHt->GetAttr().Which();
-                if (nWhich == nFontId)
-                    pFont = &(item_cast<SvxFontItem>(pHt->GetAttr()));
-                else if( nWhich == RES_TXTATR_AUTOFMT )
+                if (nWhich == RES_TXTATR_AUTOFMT)
                 {
                     const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr());
                     const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle();
     String aStr( rNode.GetTxt() );
 
     xub_StrLen nAktPos = 0;
-    xub_StrLen nEnd = aStr.Len();
+    xub_StrLen const nEnd = aStr.Len();
     bool bRedlineAtEnd = false;
     int nOpenAttrWithRange = 0;
 
         if ( aAttrIter.IsDropCap( nNextAttr ) )
             AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFmtDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner );
 
+        if (0 != nEnd)
+        {
+            // Output the character attributes
+            // #i51277# do this before writing flys at end of paragraph
+            AttrOutput().StartRunProperties();
+            aAttrIter.OutAttr( nAktPos );
+            AttrOutput().EndRunProperties( pRedlineData );
+        }
+
         // At the end of line, output the attributes until the CR.
         // Exception: footnotes at the end of line
         if ( nNextAttr == nEnd )
                 }
             }
         }
-        
-        // Output the character attributes
-        AttrOutput().StartRunProperties();
-        aAttrIter.OutAttr( nAktPos );   // nAktPos - 1 ??
-        AttrOutput().EndRunProperties( pRedlineData );
+
+        if (0 == nEnd)
+        {
+            // Output the character attributes
+            // do it after WriteCR for an empty paragraph (otherwise
+            // WW8_WrFkp::Append throws SPRMs away...)
+            AttrOutput().StartRunProperties();
+            aAttrIter.OutAttr( nAktPos );
+            AttrOutput().EndRunProperties( pRedlineData );
+        }
 
         // Exception: footnotes at the end of line
         if ( nNextAttr == nEnd )