summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/viewtab.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uiview/viewtab.cxx')
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index fb1cec99c40c..761df9d72f59 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -732,8 +732,18 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
rSh.GetCurAttr( aLRSpaceSet );
SvxFirstLineIndentItem firstLine(aLRSpaceSet.Get(RES_MARGIN_FIRSTLINE));
SvxTextLeftMarginItem leftMargin(aLRSpaceSet.Get(RES_MARGIN_TEXTLEFT));
- leftMargin.SetTextLeft(leftMargin.GetTextLeft() + firstLine.GetTextFirstLineOffset());
- firstLine.SetTextFirstLineOffset((firstLine.GetTextFirstLineOffset()) * -1);
+
+ tools::Long nIndentDist = firstLine.GetTextFirstLineOffset();
+
+ if (nIndentDist == 0)
+ {
+ const SvxTabStopItem& rDefTabItem = rSh.GetDefault(RES_PARATR_TABSTOP);
+ nIndentDist = ::GetTabDist(rDefTabItem);
+ }
+
+ leftMargin.SetTextLeft(leftMargin.GetTextLeft() + nIndentDist);
+ firstLine.SetTextFirstLineOffset(nIndentDist * -1);
+
firstLine.SetAutoFirst(false); // old code would do this, is it wanted?
rSh.SetAttrItem(firstLine);
rSh.SetAttrItem(leftMargin);