[Libreoffice-commits] core.git: Branch 'feature/mailmerge-toolbar' - 2 commits - svx/source sw/inc sw/sdi sw/source
Jan Holesovsky
kendy at collabora.com
Thu Dec 31 04:51:06 PST 2015
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 2 -
sw/inc/cmdid.h | 1
sw/sdi/swriter.sdi | 24 +++++++++++++++++++++
sw/sdi/wrtapp.sdi | 5 ++++
sw/source/uibase/app/apphdl.cxx | 8 ++++++-
sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx | 12 +++++-----
6 files changed, 44 insertions(+), 8 deletions(-)
New commits:
commit d7e1db5f006b565d55b6aa0520650226078135ca
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Dec 31 13:49:56 2015 +0100
mailmerge: Invalidate the state of the Exclude entry correctly.
Change-Id: I57cef4501eabb4883be6e655757cc497c235e93f
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index bd622fe..d4368df 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -256,6 +256,7 @@
#define FN_MAILMERGE_PREV_ENTRY (FN_INSERT + 71) /* mail merge toolbar - go to the previous entry */
#define FN_MAILMERGE_NEXT_ENTRY (FN_INSERT + 72) /* mail merge toolbar - go to the next entry */
#define FN_MAILMERGE_LAST_ENTRY (FN_INSERT + 73) /* mail merge toolbar - go to the next entry */
+#define FN_MAILMERGE_EXCLUDE_ENTRY (FN_INSERT + 74) /* mail merge toolbar - checkbox to exclude the current entry */
#define FN_DRAWTEXT_ATTR_DLG (FN_INSERT + 76) /* position DrawText */
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 2b067fc..fe92ba9 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -5323,6 +5323,30 @@ SfxVoidItem MailMergeLastEntry FN_MAILMERGE_LAST_ENTRY
GroupId = GID_DOCUMENT;
]
+SfxVoidItem MailMergeExcludeEntry FN_MAILMERGE_EXCLUDE_ENTRY
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
SfxVoidItem MailMergeCreateDocuments FN_MAILMERGE_CREATE_DOCUMENTS
()
[
diff --git a/sw/sdi/wrtapp.sdi b/sw/sdi/wrtapp.sdi
index 2a9883f..794f796 100644
--- a/sw/sdi/wrtapp.sdi
+++ b/sw/sdi/wrtapp.sdi
@@ -89,6 +89,11 @@ interface StarWriter
StateMethod = StateOther ;
]
+ FN_MAILMERGE_EXCLUDE_ENTRY
+ [
+ StateMethod = StateOther ;
+ ]
+
FN_MAILMERGE_CREATE_DOCUMENTS
[
ExecMethod = ExecOther ;
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index a6d9ff4..0503966 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -225,6 +225,12 @@ void SwModule::StateOther(SfxItemSet &rSet)
}
}
break;
+ case FN_MAILMERGE_EXCLUDE_ENTRY:
+ {
+ // just trigger calling of MMExcludeEntryController::statusChanged()
+ rSet.InvalidateItem(nWhich);
+ }
+ break;
case FN_MAILMERGE_CREATE_DOCUMENTS:
case FN_MAILMERGE_SAVE_DOCUMENTS:
case FN_MAILMERGE_PRINT_DOCUMENTS:
@@ -784,7 +790,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
rBindings.Invalidate(FN_MAILMERGE_PREV_ENTRY);
rBindings.Invalidate(FN_MAILMERGE_NEXT_ENTRY);
rBindings.Invalidate(FN_MAILMERGE_LAST_ENTRY);
- // TODO an equivalent of rBindings.Invalidate(".uno:MailMergeExcludeEntry");
+ rBindings.Invalidate(FN_MAILMERGE_EXCLUDE_ENTRY);
rBindings.Update();
}
break;
diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index 6858e96..5af7037 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -142,7 +142,7 @@ IMPL_LINK_TYPED(MMExcludeEntryController, ExcludeHdl, CheckBox&, rCheckbox, void
pConfigItem->ExcludeRecord(pConfigItem->GetResultSetPosition(), rCheckbox.IsChecked());
};
-void MMExcludeEntryController::statusChanged(const frame::FeatureStateEvent&) throw (uno::RuntimeException, std::exception)
+void MMExcludeEntryController::statusChanged(const frame::FeatureStateEvent& rEvent) throw (uno::RuntimeException, std::exception)
{
if (!m_pExcludeCheckbox)
return;
@@ -150,15 +150,15 @@ void MMExcludeEntryController::statusChanged(const frame::FeatureStateEvent&) th
SwView* pView = ::GetActiveView();
SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem();
- if (pConfigItem)
+ if (!pConfigItem || !rEvent.IsEnabled)
{
- m_pExcludeCheckbox->Enable();
- m_pExcludeCheckbox->Check(pConfigItem->IsRecordExcluded(pConfigItem->GetResultSetPosition()));
+ m_pExcludeCheckbox->Disable();
+ m_pExcludeCheckbox->Check(false);
}
else
{
- m_pExcludeCheckbox->Disable();
- m_pExcludeCheckbox->Check(false);
+ m_pExcludeCheckbox->Enable();
+ m_pExcludeCheckbox->Check(pConfigItem->IsRecordExcluded(pConfigItem->GetResultSetPosition()));
}
}
commit 409fe974e9b6caf1bd1c262adc38155aac97159e
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Dec 31 10:12:22 2015 +0100
findbar: This must be a copy'n'paste error.
Change-Id: Iecff49f04e4b68f071d63217943891a31a610aeb
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 0ae19d6..cec62ab 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -804,7 +804,7 @@ void SAL_CALL SearchFormattedToolboxController::statusChanged( const css::frame:
FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
- OUString( COMMAND_EXITSEARCH ) )
+ ".uno:FindAll" )
{
}
More information about the Libreoffice-commits
mailing list