diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-02-28 16:13:48 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-03-16 11:20:48 +0000 |
commit | cced51a1ed7c140276aabfe857510afb974fcef5 (patch) | |
tree | e0721ef743caec53daeb3a0d116c6ccb9a00c8fa /editeng/source/editeng | |
parent | 910226f2916b271a496daa6920843bf8d82238a6 (diff) |
tdf#102261: introduce editeng paragraph tab stop default distance
Adds mnDefaultDistance to SvxTabStopItem that if defined
will set a paragraph wide tab stop default distance and
override the document wide setting.
Also makes editeng consider mnDefaultDistance while getting
tab stop default distance.
Change-Id: I0fa098f874d6b9c91ddbaa2634224ff55cafcc95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148058
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'editeng/source/editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 1fbf46de184b..9fff222d9368 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -857,6 +857,13 @@ void ConvertItem( std::unique_ptr<SfxPoolItem>& rPoolItem, MapUnit eSourceUnit, assert(dynamic_cast<const SvxTabStopItem *>(rPoolItem.get()) != nullptr); SvxTabStopItem& rItem = static_cast<SvxTabStopItem&>(*rPoolItem); SvxTabStopItem* pNewItem(new SvxTabStopItem(EE_PARA_TABS)); + + if (sal_Int32 nDefTabDistance = rItem.GetDefaultDistance()) + { + pNewItem->SetDefaultDistance( + OutputDevice::LogicToLogic(nDefTabDistance, eSourceUnit, eDestUnit)); + } + for ( sal_uInt16 i = 0; i < rItem.Count(); i++ ) { const SvxTabStop& rTab = rItem[i]; @@ -1821,6 +1828,10 @@ SvxTabStop ContentAttribs::FindTabStop( sal_Int32 nCurPos, sal_uInt16 nDefTab ) return rTab; } + // if there's a default tab size defined for this item use that instead + if (rTabs.GetDefaultDistance()) + nDefTab = rTabs.GetDefaultDistance(); + // Determine DefTab ... SvxTabStop aTabStop; const sal_Int32 x = nCurPos / nDefTab + 1; |