[Libreoffice-commits] core.git: Branch 'feature/msforms' - 2 commits - officecfg/registry sw/sdi sw/source sw/uiconfig
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 15 13:08:45 UTC 2019
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 10 -
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 15 ++
sw/sdi/_textsh.sdi | 6 +
sw/source/uibase/shells/textsh1.cxx | 59 ++++++++++
sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml | 6 -
5 files changed, 85 insertions(+), 11 deletions(-)
New commits:
commit 51ff0a68210f39c3f4b25af0c0c96fe53819d279
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Feb 15 14:03:48 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Feb 15 14:03:48 2019 +0100
MSForms: Rework the MS compatible Forms menu a bit
* DateField is saved as a content control in MSO file formats
so let have it under content controls submenu
* The MS compatible forms menu is a Writer specific thing so better
to have the related commands as Writer commands.
Change-Id: I2d66130f54c055a422f56b18ff2c98667e4f6469
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 97b3e516ee4a..92c391049cbc 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6833,16 +6833,6 @@
<value xml:lang="en-US">More Fields</value>
</prop>
</node>
- <node oor:name=".uno:MSCompatActiveXControls" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">ActiveX Controls</value>
- </prop>
- </node>
- <node oor:name=".uno:MSCompatLegacyControls" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Legacy Forms</value>
- </prop>
- </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index b0b8e04cf3a7..1fdbd1c1aace 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -3402,6 +3402,21 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:MSCompatActiveXControls" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">ActiveX Controls</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MSCompatLegacyControls" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Legacy Forms</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:MSCompatContentControls" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Content Forms</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml b/sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml
index 4c8e34467d3e..4d157908dd71 100644
--- a/sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml
+++ b/sw/uiconfig/swriter/menubar/mscompatibleformsmenu.xml
@@ -21,7 +21,6 @@
<menu:menuitem menu:id=".uno:RadioButton"/>
<menu:menuitem menu:id=".uno:ListBox"/>
<menu:menuitem menu:id=".uno:Pushbutton"/>
- <menu:menuitem menu:id=".uno:DateField"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:MSCompatLegacyControls">
@@ -31,6 +30,11 @@
<menu:menuitem menu:id=".uno:DropDownFormField"/>
</menu:menupopup>
</menu:menu>
+ <menu:menu menu:id=".uno:MSCompatContentControls">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:DateField"/>
+ </menu:menupopup>
+ </menu:menu>
</menu:menupopup>
</menu:menu>
</menu:menubar>
commit f86de2767f9d936864c8fc9917e31ae487cb4a08
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Feb 15 13:50:08 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Feb 15 13:50:08 2019 +0100
MSForms: Make Control Properties menu to work with drop-down form field
Change-Id: I25055c17d887a2f2a716d8325f46825cc408179e
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index f8c2daee6d65..3724ee041ecc 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1694,5 +1694,11 @@ interface BaseText
StateMethod = StateField ;
]
+ SID_FM_CTL_PROPERTIES
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+
} // end of interface text
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 8eb590a9b5a2..ff0cfae5a414 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -119,6 +119,8 @@
#include <svx/drawitem.hxx>
#include <numrule.hxx>
#include <memory>
+#include <xmloff/odffields.hxx>
+#include <swabstdlg.hxx>
using namespace ::com::sun::star;
using namespace com::sun::star::beans;
@@ -1367,6 +1369,32 @@ void SwTextShell::Execute(SfxRequest &rReq)
GetView().UpdateWordCount(this, nSlot);
}
break;
+ case SID_FM_CTL_PROPERTIES:
+ {
+ SwPosition aPos(*GetShell().GetCursor()->GetPoint());
+ sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
+ if ( !pFieldBM )
+ {
+ --aPos.nContent;
+ pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
+ }
+
+ if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN )
+ {
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateDropDownFormFieldDialog(rWrtSh.GetView().GetFrameWeld(), pFieldBM));
+ pDlg->Execute();
+ pFieldBM->Invalidate();
+ rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() );
+ }
+ else
+ {
+ SfxRequest aReq( GetView().GetViewFrame(), SID_FM_CTL_PROPERTIES );
+ aReq.AppendItem( SfxBoolItem( SID_FM_CTL_PROPERTIES, true ) );
+ rWrtSh.GetView().GetFormShell()->Execute( aReq );
+ }
+ }
+ break;
default:
OSL_ENSURE(false, "wrong dispatcher");
return;
@@ -1906,6 +1934,37 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.DisableItem(nWhich);
}
break;
+ case SID_FM_CTL_PROPERTIES:
+ {
+ bool bDisable = false;
+
+ // First get the state from the form shell
+ SfxItemSet aSet(GetShell().GetAttrPool(), svl::Items<SID_FM_CTL_PROPERTIES, SID_FM_CTL_PROPERTIES>{});
+ aSet.Put(SfxBoolItem( SID_FM_CTL_PROPERTIES, true ));
+ GetShell().GetView().GetFormShell()->GetState( aSet );
+
+ if(SfxItemState::DISABLED == aSet.GetItemState(SID_FM_CTL_PROPERTIES))
+ {
+ bDisable = true;
+ }
+
+ // Enable it if we have a valid object other than what form shell knows
+ SwPosition aPos(*GetShell().GetCursor()->GetPoint());
+ sw::mark::IFieldmark* pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
+ if ( !pFieldBM )
+ {
+ --aPos.nContent;
+ pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
+ }
+ if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN )
+ {
+ bDisable = false;
+ }
+
+ if(bDisable)
+ rSet.DisableItem(nWhich);
+ }
+ break;
}
nWhich = aIter.NextWhich();
}
More information about the Libreoffice-commits
mailing list