summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in8
-rw-r--r--include/svx/ClassificationDialog.hxx11
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs6
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx50
-rw-r--r--svx/uiconfig/ui/classificationdialog.ui2
6 files changed, 72 insertions, 7 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 8fb5d4c803c7..85a65eaf3df1 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -677,8 +677,12 @@
generic-name="Text View" parent="GtkTextView"
icon-name="widget-gtk-textentry"/>
- <glade-widget-class title="Text View" name="svxlo-ClassificationEditView"
- generic-name="Text View" parent="GtkTextView"
+ <glade-widget-class title="Classifcation Text View" name="svxlo-ClassificationEditView"
+ generic-name="Classifcation Text View" parent="GtkTextView"
+ icon-name="widget-gtk-textentry"/>
+
+ <glade-widget-class title="IntellectualPropertyPartEdit" name="svxlo-IntellectualPropertyPartEdit"
+ generic-name="IntellectualPropertyPartEdit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Combo Image Button" name="sclo-ScExtIButton"
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx
index 59502eca4286..164701d2c3a4 100644
--- a/include/svx/ClassificationDialog.hxx
+++ b/include/svx/ClassificationDialog.hxx
@@ -25,6 +25,15 @@
namespace svx {
+class IntellectualPropertyPartEdit : public Edit
+{
+public:
+ IntellectualPropertyPartEdit(vcl::Window* pParent);
+
+protected:
+ virtual void KeyInput(const KeyEvent &rKEvt) override;
+};
+
class SVX_DLLPUBLIC ClassificationDialog : public ModalDialog
{
private:
@@ -39,7 +48,7 @@ private:
VclPtr<ListBox> m_pIntellectualPropertyPartListBox;
VclPtr<ListBox> m_pIntellectualPropertyPartNumberListBox;
VclPtr<PushButton> m_pIntellectualPropertyPartAddButton;
- VclPtr<Edit> m_pIntellectualPropertyPartEdit;
+ VclPtr<IntellectualPropertyPartEdit> m_pIntellectualPropertyPartEdit;
VclPtr<VclExpander> m_pIntellectualPropertyExpander;
SfxClassificationHelper maHelper;
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index c6bbd2d46058..33c1db97f618 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -541,5 +541,7 @@
</prop>
<prop oor:name="AdvancedClassificationDialogIntellectualPropertySectionExpanded" oor:type="xs:boolean">
</prop>
+ <prop oor:name="AdvancedClassificationDialogIntellectualPropertyTextInputIsFreeForm" oor:type="xs:boolean">
+ </prop>
</node>
</oor:component-data>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index fe7f8e806a7b..22c92a7124fa 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6399,6 +6399,12 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="AdvancedClassificationDialogIntellectualPropertyTextInputIsFreeForm" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Specifies if the intellectual property text is free-form or limited to ';', '/' and ' ' characters.</desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
</component>
</oor:component-schema>
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index 2e8b0c4ad8fc..6c70d97dd83f 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -25,11 +25,55 @@
#include <config_folders.h>
#include <tools/XmlWriter.hxx>
#include <tools/XmlWalker.hxx>
+#include <vcl/builderfactory.hxx>
#include <officecfg/Office/Common.hxx>
namespace svx {
+
+IntellectualPropertyPartEdit::IntellectualPropertyPartEdit(vcl::Window* pParent)
+ : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK|WB_TABSTOP)
+{
+}
+
+VCL_BUILDER_FACTORY(IntellectualPropertyPartEdit)
+
+void IntellectualPropertyPartEdit::KeyInput(const KeyEvent& rKeyEvent)
+{
+ bool bTextIsFreeForm = officecfg::Office::Common::Classification::AdvancedClassificationDialogIntellectualPropertyTextInputIsFreeForm::get();
+
+ if (bTextIsFreeForm)
+ {
+ Edit::KeyInput(rKeyEvent);
+ }
+ else
+ {
+ // Ignore key combination with modifier keys
+ if (rKeyEvent.GetKeyCode().IsMod3()
+ || rKeyEvent.GetKeyCode().IsMod2()
+ || rKeyEvent.GetKeyCode().IsMod1())
+ {
+ return;
+ }
+
+ switch (rKeyEvent.GetKeyCode().GetCode())
+ {
+ // Allowed characters
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ case KEY_DIVIDE:
+ case KEY_SEMICOLON:
+ case KEY_SPACE:
+ Edit::KeyInput(rKeyEvent);
+ return;
+ // Anything else is ignored
+ default:
+ break;
+ }
+ }
+}
+
namespace {
constexpr size_t RECENTLY_USED_LIMIT = 5;
@@ -51,7 +95,7 @@ bool fileExists(OUString const & sFilename)
return osl::FileBase::E_None == eRC;
}
-bool stringToclassificationType(OString const & rsType, svx::ClassificationType & reType)
+bool stringToClassificationType(OString const & rsType, svx::ClassificationType & reType)
{
if (rsType == "CATEGORY")
reType = svx::ClassificationType::CATEGORY;
@@ -296,7 +340,7 @@ void ClassificationDialog::readRecentlyUsed()
// Convert string to classification type, but continue only if
// conversion was successful.
- if (stringToclassificationType(aWalker.attribute("type"), eType))
+ if (stringToClassificationType(aWalker.attribute("type"), eType))
{
aWalker.children();
@@ -617,6 +661,6 @@ IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void)
}
}
-} // end sfx2
+} // end svx
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index b953c003e0ec..40464427568a 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -294,7 +294,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="intellectualPropertyPartEntry">
+ <object class="svxlo-IntellectualPropertyPartEdit" id="intellectualPropertyPartEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>