summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2012-11-22 11:46:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-27 10:16:35 +0100
commit11eb95f74088ff830f6aa994250ef18335ca70c2 (patch)
tree5cf285c1288c119dc6ff70db67845fb4bcb60ece /sw
parenta653bda02b2aac650eef8d6fbca28b3280f7ed0a (diff)
Resolves: #i120938# consider left indentation when converting...
tab stop positions of styles (cherry picked from commit 7b20978d84db1f7f545ff608bdb09275813e2219) Change-Id: I068a8dced069c4676623723f16ae4d85997f086d
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx55
1 files changed, 34 insertions, 21 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d2dae7ce0599..e0d9140f1014 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);
}
}