[Libreoffice-commits] core.git: 2 commits - sw/source

Oliver-Rainer Wittmann orw at apache.org
Thu Jun 27 02:16:56 PDT 2013


 sw/source/core/inc/bodyfrm.hxx    |    5 ---
 sw/source/core/layout/pagechg.cxx |   16 -----------
 sw/source/filter/ww8/ww8atr.cxx   |   55 +++++++++++++++++++++++---------------
 3 files changed, 34 insertions(+), 42 deletions(-)

New commits:
commit 11eb95f74088ff830f6aa994250ef18335ca70c2
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Thu Nov 22 11:46:44 2012 +0000

    Resolves: #i120938# consider left indentation when converting...
    
    tab stop positions of styles
    
    (cherry picked from commit 7b20978d84db1f7f545ff608bdb09275813e2219)
    
    Change-Id: I068a8dced069c4676623723f16ae4d85997f086d

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d2dae7c..e0d9140 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4853,8 +4853,9 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
 }
 
 
-static void ParaTabStopAdd( WW8Export& rWrt, const SvxTabStopItem& rTStops,
-    long nLParaMgn )
+static void ParaTabStopAdd( WW8Export& rWrt,
+                            const SvxTabStopItem& rTStops,
+                            const long nLParaMgn )
 {
     SwWW8WrTabu aTab( 0, rTStops.Count());
 
@@ -4879,8 +4880,11 @@ static bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne,
           );
 }
 
-static void ParaTabStopDelAdd( WW8Export& rWrt, const SvxTabStopItem& rTStyle,
-    long nLStypeMgn, const SvxTabStopItem& rTNew, long nLParaMgn )
+static void ParaTabStopDelAdd( WW8Export& rWrt,
+                               const SvxTabStopItem& rTStyle,
+                               const long nLStypeMgn,
+                               const SvxTabStopItem& rTNew,
+                               const long nLParaMgn )
 {
     SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count());
 
@@ -4956,15 +4960,15 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, const SvxTabStopItem& rTStyle,
 
 void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
 {
-    bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
-    long nCurrentLeft = 0;
+    const bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
 
+    long nCurrentLeft = 0;
     if ( bTabsRelativeToIndex )
     {
         const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE );
 
         if ( pLR != NULL )
-            nCurrentLeft = ((const SvxLRSpaceItem*)pLR)->GetTxtLeft();
+            nCurrentLeft = static_cast<const SvxLRSpaceItem*>(pLR)->GetTxtLeft();
     }
 
     // #i100264#
@@ -4972,41 +4976,50 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
          m_rWW8Export.pCurrentStyle != NULL &&
          m_rWW8Export.pCurrentStyle->DerivedFrom() != NULL )
     {
-        SvxTabStopItem aTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
+        SvxTabStopItem aParentTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
         const SwFmt *pParentStyle = m_rWW8Export.pCurrentStyle->DerivedFrom();
-        const SvxTabStopItem* pParentTabs = HasItem<SvxTabStopItem>( pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
-        if ( pParentTabs )
         {
-            aTabs.Insert( pParentTabs );
+            const SvxTabStopItem* pParentTabs = HasItem<SvxTabStopItem>( pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
+            if ( pParentTabs )
+            {
+                aParentTabs.Insert( pParentTabs );
+            }
+        }
+
+        // #i120938# - consider left indentation of style and its parent style
+        long nParentLeft = 0;
+        if ( bTabsRelativeToIndex )
+        {
+            const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>( pParentStyle->GetAttrSet(), RES_LR_SPACE );
+            nParentLeft = rStyleLR.GetTxtLeft();
         }
 
-        ParaTabStopDelAdd( m_rWW8Export, aTabs, 0, rTabStops, 0 );
+        ParaTabStopDelAdd( m_rWW8Export, aParentTabs, nParentLeft, rTabStops, nCurrentLeft );
         return;
     }
 
-    // StyleDef -> "einfach" eintragen || keine Style-Attrs -> dito
     const SvxTabStopItem* pStyleTabs = 0;
     if ( !m_rWW8Export.bStyDef && m_rWW8Export.pStyAttr )
     {
-        pStyleTabs =
-            HasItem<SvxTabStopItem>( *m_rWW8Export.pStyAttr, RES_PARATR_TABSTOP );
+        pStyleTabs = HasItem<SvxTabStopItem>( *m_rWW8Export.pStyAttr, RES_PARATR_TABSTOP );
     }
 
     if ( !pStyleTabs )
+    {
         ParaTabStopAdd(m_rWW8Export, rTabStops, nCurrentLeft);
+    }
     else
     {
         long nStyleLeft = 0;
-
-        if (bTabsRelativeToIndex)
+        if ( bTabsRelativeToIndex )
         {
-            const SvxLRSpaceItem &rStyleLR =
-            ItemGet<SvxLRSpaceItem>(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
+            const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
             nStyleLeft = rStyleLR.GetTxtLeft();
         }
 
-        ParaTabStopDelAdd(m_rWW8Export, *pStyleTabs, nStyleLeft, rTabStops,
-            nCurrentLeft);
+        ParaTabStopDelAdd( m_rWW8Export,
+                           *pStyleTabs, nStyleLeft,
+                           rTabStops, nCurrentLeft);
     }
 }
 
commit a653bda02b2aac650eef8d6fbca28b3280f7ed0a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 27 09:46:15 2013 +0100

    fix highest debugging level build
    
    Change-Id: I1f40bba348a3c0be7a892b56a9bf1b7da0b4435f

diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 52613a7..e73b701 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -29,14 +29,9 @@ class SwBodyFrm: public SwLayoutFrm
 protected:
     virtual void Format( const SwBorderAttrs *pAttrs = 0 );
 
-#if defined ( __GNUC__ ) && defined ( C272 )
-    ~SwBodyFrm();
-#endif
-
 public:
     SwBodyFrm( SwFrmFmt*, SwFrm* );
 
-    virtual void Paint( const SwRect&, const SwPrintData *pPrintData = NULL ) const;
     virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 304bbcb..a231fd1 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -177,22 +177,6 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
     mbValidSize = mbValidPrtArea = sal_True;
 }
 
-void SwBodyFrm::Paint( const SwRect& rRect, const SwPrintData* ) const
-{
-#if OSL_DEBUG_LEVEL > 1
-    // Paint a red border around the SwBodyFrm in debug mode
-    ViewShell *pSh = GetShell();
-    OutputDevice* pOut =  pSh->GetOut();
-    pOut->Push();
-    pOut->SetLineColor(Color(255, 0, 0));
-    pOut->SetFillColor(COL_TRANSPARENT);
-    SwRect aRect = Frm();
-    pOut->DrawRect(aRect.SVRect());
-    pOut->Pop();
-#endif
-    SwLayoutFrm::Paint(rRect);
-}
-
 /*************************************************************************
 |*
 |*  SwPageFrm::SwPageFrm(), ~SwPageFrm()


More information about the Libreoffice-commits mailing list