summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/txtattr.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-02-14 18:03:55 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-02-24 07:32:23 +0000
commitdb115bec9254417ef7a3faf687478fe5424ab378 (patch)
tree0b5f58cda73137302fd955db3e0958dda71358fb /sw/source/uibase/shells/txtattr.cxx
parent7e7b69829db63e64b8aed8d03c6eaed6d8f1a27c (diff)
tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl
Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now. Add new items RES_MARGIN_LEFT etc., order them so that paragraphs can have 3 consecutive items RES_MARGIN_FIRSTLINE..RES_MARGIN_RIGHT and non-paragraphs also have 2-4 consecutive items RES_MARGIN_RIGHT..RES_MARGIN_LEFT (only the 3 paragraph ones are actually used now). The HTML import filter is particularly annoying because it parses CSS stuff into SfxItemSets without knowing where the items will be applied, so it can't know whether to create SvxLeftMarginItem or SvxTextLeftMarginItem... the split items are created in ParseCSS1_* functions and then converted later if necessary. WW8 import has some weird code as well, SwWW8ImplReader::Read_LR() creates 3 items and then something wants to set every item on its own so SwWW8FltControlStack::SetAttrInDoc() turned out rather weird. Convert the paragraph dialog to handle the split items (by mapping them to SID_ATTR_PARA_FIRSTLINESPACE/SID_ATTR_PARA_LEFTSPACE/ SID_ATTR_PARA_RIGHTSPACE), but the SvxRuler looks a bit more confusing so convert in sw shells for now and leave that for later (also unclear if changing these slot items like SID_ATTR_PARA_LRSPACE breaks any ABIs?). Change-Id: I40431821868fd3e1cceba121b5539ff9ae6befbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147024 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/uibase/shells/txtattr.cxx')
-rw-r--r--sw/source/uibase/shells/txtattr.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 8f5c87a8ffc4..6a916f2f5ced 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -745,10 +745,19 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
case SID_ATTR_PARA_RIGHTSPACE:
case SID_ATTR_PARA_FIRSTLINESPACE:
{
- eState = aCoreSet.GetItemState(RES_LR_SPACE);
+ eState = aCoreSet.GetItemState(RES_MARGIN_FIRSTLINE);
+ eState = std::min(aCoreSet.GetItemState(RES_MARGIN_TEXTLEFT), eState);
+ eState = std::min(aCoreSet.GetItemState(RES_MARGIN_RIGHT), eState);
if( eState >= SfxItemState::DEFAULT )
{
- SvxLRSpaceItem aLR = aCoreSet.Get( RES_LR_SPACE );
+ SvxLRSpaceItem aLR(RES_LR_SPACE);
+ SvxFirstLineIndentItem const& rFirstLine(aCoreSet.Get(RES_MARGIN_FIRSTLINE));
+ SvxTextLeftMarginItem const& rLeftMargin(aCoreSet.Get(RES_MARGIN_TEXTLEFT));
+ SvxRightMarginItem const& rRightMargin(aCoreSet.Get(RES_MARGIN_RIGHT));
+ aLR.SetTextFirstLineOffset(rFirstLine.GetTextFirstLineOffset(), rFirstLine.GetPropTextFirstLineOffset());
+ aLR.SetAutoFirst(rFirstLine.IsAutoFirst());
+ aLR.SetTextLeft(rLeftMargin.GetTextLeft(), rLeftMargin.GetPropLeft());
+ aLR.SetRight(rRightMargin.GetRight(), rRightMargin.GetPropRight());
aLR.SetWhich(nSlot);
rSet.Put(aLR);
}