Related: tdf#160833 sw DoNotMirrorRtlDrawObjs: add enable/disable option UI
Doing this via a macro was possible already, but that didn't invalidate the object positions on the layout, so required a document reload, which was ugly. Change-Id: I65dec046727588952f8e41a89eae25f81feb7f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167182 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
This commit is contained in:
@@ -152,6 +152,12 @@
|
||||
</info>
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="DoNotMirrorRtlDrawObjs" oor:type="xs:boolean" oor:nillable="false">
|
||||
<info>
|
||||
<desc>Do not mirror drawing objects anchored in paragraphs with an RTL writing direction</desc>
|
||||
</info>
|
||||
<value>false</value>
|
||||
</prop>
|
||||
</group>
|
||||
</templates>
|
||||
<component>
|
||||
|
@@ -1492,6 +1492,7 @@
|
||||
#define STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER NC_("STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER", "Do not add an extra space after number in footnotes / endnotes with hanging first line")
|
||||
#define STR_COMPAT_OPT_TABSRELATIVETOINDENT NC_("STR_COMPAT_OPT_TABSRELATIVETOINDENT", "Set tabstops relative to indent of paragraph")
|
||||
#define STR_COMPAT_OPT_TABOVERMARGIN NC_("STR_COMPAT_OPT_TABOVERMARGIN", "Allow tabs to extend beyond the right margin")
|
||||
#define STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS NC_("DO_NOT_MIRROR_RTL_DRAW_OBJS", "Do not mirror drawing objects anchored in paragraphs with an RTL writing direction")
|
||||
|
||||
#define STR_TABLE_PANEL_ALIGN_AUTO NC_("sidebartableedit|alignautolabel", "Automatic")
|
||||
#define STR_TABLE_PANEL_ALIGN_LEFT NC_("sidebartableedit|alignleftlabel", "Left")
|
||||
|
@@ -451,6 +451,8 @@ public:
|
||||
|
||||
SW_DLLPUBLIC void SetTabOverMargin(bool bNew);
|
||||
|
||||
SW_DLLPUBLIC void SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs);
|
||||
|
||||
// DOCUMENT COMPATIBILITY FLAGS END
|
||||
|
||||
// Calls Idle-formatter of Layout.
|
||||
|
@@ -139,6 +139,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
|
||||
mbNoGapAfterNoteNumber = aOptions.get(u"NoGapAfterNoteNumber"_ustr);
|
||||
mbTabRelativeToIndent = aOptions.get(u"TabsRelativeToIndent"_ustr);
|
||||
mbTabOverMargin = aOptions.get(u"TabOverMargin"_ustr);
|
||||
mbDoNotMirrorRtlDrawObjs = aOptions.get(u"DoNotMirrorRtlDrawObjs"_ustr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1083,6 +1083,17 @@ void SwViewShell::SetTabOverMargin(bool bNew)
|
||||
}
|
||||
}
|
||||
|
||||
void SwViewShell::SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs)
|
||||
{
|
||||
IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
|
||||
if (rIDSA.get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS) != bDoNotMirrorRtlDrawObjs)
|
||||
{
|
||||
SwWait aWait(*GetDoc()->GetDocShell(), true);
|
||||
rIDSA.set(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS, bDoNotMirrorRtlDrawObjs);
|
||||
lcl_InvalidateAllObjPos(*this);
|
||||
}
|
||||
}
|
||||
|
||||
void SwViewShell::Reformat()
|
||||
{
|
||||
SwWait aWait( *GetDoc()->GetDocShell(), true );
|
||||
|
@@ -62,6 +62,7 @@ constexpr std::pair<OUString, TranslateId> options_list[]{
|
||||
{ u"NoGapAfterNoteNumber"_ustr, STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER },
|
||||
{ u"TabsRelativeToIndent"_ustr, STR_COMPAT_OPT_TABSRELATIVETOINDENT },
|
||||
{ u"TabOverMargin"_ustr, STR_COMPAT_OPT_TABOVERMARGIN },
|
||||
{ u"DoNotMirrorRtlDrawObjs"_ustr, STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS },
|
||||
};
|
||||
|
||||
// DocumentSettingId, negate?
|
||||
@@ -86,6 +87,7 @@ std::pair<DocumentSettingId, bool> DocumentSettingForOption(const OUString& opti
|
||||
{ u"NoGapAfterNoteNumber"_ustr, { DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER, false } },
|
||||
{ u"TabsRelativeToIndent"_ustr, { DocumentSettingId::TABS_RELATIVE_TO_INDENT, false } },
|
||||
{ u"TabOverMargin"_ustr, { DocumentSettingId::TAB_OVER_MARGIN, false } },
|
||||
{ u"DoNotMirrorRtlDrawObjs"_ustr, { DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS, false } },
|
||||
// { u"AddTableLineSpacing"_ustr, { DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, false } },
|
||||
};
|
||||
return map.at(option);
|
||||
@@ -318,6 +320,10 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* )
|
||||
m_pWrtShell->SetTabOverMargin(bChecked);
|
||||
break;
|
||||
|
||||
case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
|
||||
m_pWrtShell->SetDoNotMirrorRtlDrawObjs(bChecked);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user