summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-05-26 15:14:45 +0300
committerGülşah Köse <gulsah.1004@gmail.com>2017-05-30 08:49:53 +0200
commit61ff1d919e317947c769e61eeda7f1bb8132f273 (patch)
tree6a46367601589ef52ca5bbc1a57704926fb30119
parent182a62e0f199d26df0ae76ebf224c5d4b0fc3e26 (diff)
tdf#107589 Make description editable from Options tab.
That commit makes possible to edit descriptions of images frames and objects from "Options" tab of Object/Properties dialogs Change-Id: I62d06b32da6919df62ff77b50c4c77d6a265bd64 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/38176 Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx14
-rw-r--r--sw/source/uibase/inc/frmpage.hxx2
-rw-r--r--sw/source/uibase/shells/frmsh.cxx6
-rw-r--r--sw/source/uibase/shells/grfsh.cxx6
-rw-r--r--sw/uiconfig/swriter/ui/frmaddpage.ui160
5 files changed, 107 insertions, 81 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index b26dd9916e82..3a85effb9647 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -382,6 +382,7 @@ const sal_uInt16 SwFrameAddPage::aAddPgRg[] = {
RES_PRINT, RES_PRINT,
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
+ FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION,
0
};
@@ -2875,6 +2876,8 @@ SwFrameAddPage::SwFrameAddPage(vcl::Window *pParent, const SfxItemSet &rSet)
get(m_pPrevLB,"prev");
get(m_pNextFT,"next_label");
get(m_pNextLB,"next");
+ get(m_pDescriptionFT, "description_label");
+ get(m_pDescriptionED, "description");
get(m_pProtectFrame,"protect");
get(m_pProtectContentCB,"protectcontent");
@@ -2890,6 +2893,7 @@ SwFrameAddPage::SwFrameAddPage(vcl::Window *pParent, const SfxItemSet &rSet)
get(m_pTextFlowFT,"textflow_label");
get(m_pTextFlowLB,"textflow");
+ m_pDescriptionED->set_height_request(m_pDescriptionED->get_preferred_size().Height());
}
SwFrameAddPage::~SwFrameAddPage()
@@ -2919,6 +2923,8 @@ void SwFrameAddPage::dispose()
m_pPrintFrameCB.clear();
m_pTextFlowFT.clear();
m_pTextFlowLB.clear();
+ m_pDescriptionFT.clear();
+ m_pDescriptionED.clear();
SfxTabPage::dispose();
}
@@ -2955,6 +2961,12 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet )
m_pAltNameED->SaveValue();
}
+ if(SfxItemState::SET == rSet->GetItemState(FN_UNO_DESCRIPTION, false, &pItem))
+ {
+ m_pDescriptionED->SetText(static_cast<const SfxStringItem*>(pItem)->GetValue());
+ m_pDescriptionED->SaveValue();
+ }
+
if(!m_bFormat)
{
// insert graphic - properties
@@ -3120,6 +3132,8 @@ bool SwFrameAddPage::FillItemSet(SfxItemSet *rSet)
bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_NAME, m_pNameED->GetText()));
if (m_pAltNameED->IsValueChangedFromSaved())
bRet |= nullptr != rSet->Put(SfxStringItem(FN_SET_FRM_ALT_NAME, m_pAltNameED->GetText()));
+ if (m_pDescriptionED->IsValueChangedFromSaved())
+ bRet |= nullptr != rSet->Put(SfxStringItem(FN_UNO_DESCRIPTION, m_pDescriptionED->GetText()));
const SfxPoolItem* pOldItem;
SvxProtectItem aProt ( static_cast<const SvxProtectItem& >(GetItemSet().Get(RES_PROTECT)) );
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 63fb4db07eb6..9aa04255aab4 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -278,6 +278,8 @@ class SwFrameAddPage : public SfxTabPage
VclPtr<Edit> m_pNameED;
VclPtr<FixedText> m_pAltNameFT;
VclPtr<Edit> m_pAltNameED;
+ VclPtr<FixedText> m_pDescriptionFT;
+ VclPtr<Edit> m_pDescriptionED;
VclPtr<FixedText> m_pPrevFT;
VclPtr<ListBox> m_pPrevLB;
VclPtr<FixedText> m_pNextFT;
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index b617d3fa9970..a008774512a8 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -408,9 +408,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
FN_SURROUND, FN_HORI_ORIENT, // [21303
FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306
FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, // [21318
+ FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION, // [21320
FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, // [22314
FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, // [22420
-
0);
// create needed items for XPropertyList entries from the DrawModel so that
@@ -423,6 +423,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
aSet.Put( SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()) );
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
+ aSet.Put(SfxStringItem(FN_UNO_DESCRIPTION, rSh.GetObjDescription()));
if( nSel & SelectionType::Ole )
{
// #i73249#
@@ -498,6 +499,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
// #i73249#
rSh.SetObjTitle(static_cast<const SfxStringItem*>(pItem)->GetValue());
}
+ if (SfxItemState::SET == pOutSet->GetItemState(FN_UNO_DESCRIPTION, true, &pItem))
+ rSh.SetObjDescription(static_cast<const SfxStringItem*>(pItem)->GetValue());
+
// Template AutoUpdate
SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
if(pFormat && pFormat->IsAutoUpdateFormat())
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index a334edc3edf7..2fb6a19713a4 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -244,6 +244,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
FN_SET_FRM_NAME,FN_KEEP_ASPECT_RATIO, // [21306
FN_SET_FRM_ALT_NAME,FN_SET_FRM_ALT_NAME, // [21318
SID_REFERER, SID_REFERER,
+ FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION, // [21320
0);
// create needed items for XPropertyList entries from the DrawModel so that
@@ -267,6 +268,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put( aFrameSize );
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
+ aSet.Put(SfxStringItem(FN_UNO_DESCRIPTION, rSh.GetObjDescription()));
if ( nSlot == FN_FORMAT_GRAFIC_DLG )
{
// #i73249#
@@ -455,6 +457,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
rSh.SetObjTitle( static_cast<const SfxStringItem*>(pItem)->GetValue() );
}
+ if ( SfxItemState::SET == pSet->GetItemState(
+ FN_UNO_DESCRIPTION, true, &pItem ))
+ rSh.SetObjDescription( static_cast<const SfxStringItem*>(pItem)->GetValue() );
+
SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN,
RES_GRFATR_END-1 );
aGrfSet.Put( *pSet );
diff --git a/sw/uiconfig/swriter/ui/frmaddpage.ui b/sw/uiconfig/swriter/ui/frmaddpage.ui
index fae37d0c4920..ad22ac5563d4 100644
--- a/sw/uiconfig/swriter/ui/frmaddpage.ui
+++ b/sw/uiconfig/swriter/ui/frmaddpage.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkListStore" id="liststore">
<columns>
<!-- column-name gchararray1 -->
@@ -23,6 +24,43 @@
</row>
</data>
</object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ <!-- column-name gint1 -->
+ <column type="gint"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Left-to-right</col>
+ <col id="1">0</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Right-to-left</col>
+ <col id="1">1</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Right-to-left (vertical)</col>
+ <col id="1">2</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Left-to-right (vertical)</col>
+ <col id="1">3</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Use superordinate object settings</col>
+ <col id="1">4</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkTextBuffer" id="textbuffer1">
+ <property name="text">
+
+
+
+</property>
+ </object>
<object class="GtkBox" id="FrameAddPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -62,8 +100,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -77,40 +113,34 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Name:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">name</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="altname_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Alternative (Text only):</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">altname</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -124,9 +154,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -140,41 +168,67 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="prev_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Previous link:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prev</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="next_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Next link:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">next</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="description_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Description:</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="description:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ <property name="buffer">textbuffer1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
</object>
@@ -230,8 +284,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -243,8 +295,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -265,8 +315,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -304,8 +352,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -321,8 +367,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -338,8 +382,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -360,8 +402,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -408,8 +448,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -425,8 +463,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -441,16 +477,14 @@
<object class="GtkLabel" id="textflow_label">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Text direction:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">textflow</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -462,16 +496,12 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -496,36 +526,6 @@
</packing>
</child>
</object>
- <object class="GtkListStore" id="liststore1">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- <!-- column-name gint1 -->
- <column type="gint"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Left-to-right</col>
- <col id="1">0</col>
- </row>
- <row>
- <col id="0" translatable="yes">Right-to-left</col>
- <col id="1">1</col>
- </row>
- <row>
- <col id="0" translatable="yes">Right-to-left (vertical)</col>
- <col id="1">2</col>
- </row>
- <row>
- <col id="0" translatable="yes">Left-to-right (vertical)</col>
- <col id="1">3</col>
- </row>
- <row>
- <col id="0" translatable="yes">Use superordinate object settings</col>
- <col id="1">4</col>
- </row>
- </data>
- </object>
<object class="GtkSizeGroup" id="sizegroup1">
<property name="ignore_hidden">True</property>
<widgets>