summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-01-29 14:53:43 +0100
committerLászló Németh <nemeth@numbertext.org>2019-01-29 20:40:30 +0100
commit9c4eef7d809ad7d283860c7b47b0f561aa240906 (patch)
tree72ee40f8545473ab8240082c9dc3b9a25994dde4 /svx
parent930ec0e6ab7bd5492fb4cf4a8f6860e3b728929d (diff)
tdf#52391 reject/clear formatting of format-only changes
Format-only changes had 1) disabled (in Manage Changes dialog window) or 2) bad rejection (Track Changes toolbar icons and Edit->Track Changes menu item functions "Reject"/"Reject All" resulted acception of the tracked format-only changes instead of rejection). Because format-only changes haven't had real rejection support, yet, this commit 1) adds an often useful reject-like function in the Manage Changes dialog window: instead of disabling Reject/Reject All, now these buttons clears direct text formatting in the area of the tracked format-only changes. Because this may be not a rejection (ie. the original text can contain direct text formatting), the labels of the button warn about it: "Reject/Clear formatting" and "Reject All/Clear formatting". Note: "Reject All" still rejects only insertions/deletions at (now first) pressing, as from commit a8a3928bd3614e52edc0a4df6f67ce53e787905c. 2) Icons and menu items "Reject"/"Reject All" clear direct text formatting in the areas of the tracked format-only changes. Note: this is still not ideal, but it can help to avoid of unintended direct text formatting until implementing upcoming ODF 1.3 change tracking. Change-Id: I87c3ac6165019cae9c49ed4591eaadef9e06beb5 Reviewed-on: https://gerrit.libreoffice.org/67080 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/ctredlin.cxx40
-rw-r--r--svx/uiconfig/ui/acceptrejectchangesdialog.ui5
2 files changed, 45 insertions, 0 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 188d7bc582e3..5e1aefc7f7c2 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -32,6 +32,8 @@
#include <editeng/unolingu.hxx>
#include <svx/ctredlin.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/strings.hrc>
#define WRITER_DATE 2
#define CALC_DATE 3
@@ -371,6 +373,11 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel)
pTopLevel->get(m_pRejectAll, "rejectall");
pTopLevel->get(m_pUndo, "undo");
+ // set wider window for the optional extending button labels
+ // eg. "Reject/Clear formatting" instead of "Reject"
+ EnableClearFormat(true);
+ EnableClearFormatAll(true);
+
SvSimpleTableContainer* pTable = get<SvSimpleTableContainer>("changes");
Size aControlSize(80, 65);
aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont));
@@ -483,6 +490,39 @@ void SvxTPView::EnableRejectAll(bool bFlag)
m_pRejectAll->Enable(bFlag);
}
+void SvxTPView::EnableClearFormatButton(VclPtr<PushButton> pButton, bool bFlag)
+{
+ OUString sText = pButton->GetText();
+ OUString sClearFormat = SvxResId(RID_SVXSTR_CLEARFORM);
+ sal_Int32 nPos = sText.indexOf(sClearFormat);
+
+ // add or remove "Clear formatting" to get "Reject" or "Reject/Clear formatting"
+ if (bFlag)
+ {
+ if (nPos == -1)
+ {
+ pButton->SetText(sText + "/" + sClearFormat);
+ }
+ }
+ else
+ {
+ if (nPos > 0)
+ {
+ pButton->SetText(sText.copy(0, nPos - 1));
+ }
+ }
+}
+
+void SvxTPView::EnableClearFormat(bool bFlag)
+{
+ EnableClearFormatButton( m_pReject, bFlag );
+}
+
+void SvxTPView::EnableClearFormatAll(bool bFlag)
+{
+ EnableClearFormatButton( m_pRejectAll, bFlag );
+}
+
void SvxTPView::ShowUndo()
{
m_pUndo->Show();
diff --git a/svx/uiconfig/ui/acceptrejectchangesdialog.ui b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
index 0161bff86885..7e9817689a99 100644
--- a/svx/uiconfig/ui/acceptrejectchangesdialog.ui
+++ b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
@@ -28,6 +28,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
@@ -42,6 +43,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
@@ -56,6 +58,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
@@ -70,6 +73,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
@@ -84,6 +88,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>