From 61ff1d919e317947c769e61eeda7f1bb8132f273 Mon Sep 17 00:00:00 2001 From: Gulsah Kose Date: Fri, 26 May 2017 15:14:45 +0300 Subject: 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 Reviewed-on: https://gerrit.libreoffice.org/38176 Tested-by: Jenkins --- sw/source/ui/frmdlg/frmpage.cxx | 14 +++ sw/source/uibase/inc/frmpage.hxx | 2 + sw/source/uibase/shells/frmsh.cxx | 6 +- sw/source/uibase/shells/grfsh.cxx | 6 ++ sw/uiconfig/swriter/ui/frmaddpage.ui | 160 +++++++++++++++++------------------ 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(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(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 m_pNameED; VclPtr m_pAltNameFT; VclPtr m_pAltNameED; + VclPtr m_pDescriptionFT; + VclPtr m_pDescriptionED; VclPtr m_pPrevFT; VclPtr m_pPrevLB; VclPtr 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(pItem)->GetValue()); } + if (SfxItemState::SET == pOutSet->GetItemState(FN_UNO_DESCRIPTION, true, &pItem)) + rSh.SetObjDescription(static_cast(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(pItem)->GetValue() ); } + if ( SfxItemState::SET == pSet->GetItemState( + FN_UNO_DESCRIPTION, true, &pItem )) + rSh.SetObjDescription( static_cast(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 @@ + - + @@ -23,6 +24,43 @@ + + + + + + + + + + Left-to-right + 0 + + + Right-to-left + 1 + + + Right-to-left (vertical) + 2 + + + Left-to-right (vertical) + 3 + + + Use superordinate object settings + 4 + + + + + + + + + + True False @@ -62,8 +100,6 @@ 1 0 - 1 - 1 @@ -77,40 +113,34 @@ 1 1 - 1 - 1 True False - 0 _Name: True name + 0 0 0 - 1 - 1 True False - 0 _Alternative (Text only): True altname + 0 0 1 - 1 - 1 @@ -124,9 +154,7 @@ 1 - 2 - 1 - 1 + 3 @@ -140,41 +168,67 @@ 1 - 3 - 1 - 1 + 4 True False - 0 _Previous link: True prev + 0 0 - 2 - 1 - 1 + 3 True False - 0 _Next link: True next + 0 0 - 3 - 1 - 1 + 4 + + + + + True + False + _Description: + True + 0 + + + 0 + 2 + + + + + True + True + in + + + True + True + word + textbuffer1 + + + + + 1 + 2 @@ -230,8 +284,6 @@ 0 0 - 1 - 1 @@ -243,8 +295,6 @@ 1 0 - 1 - 1 @@ -265,8 +315,6 @@ 1 0 - 1 - 1 @@ -304,8 +352,6 @@ 0 0 - 1 - 1 @@ -321,8 +367,6 @@ 0 1 - 1 - 1 @@ -338,8 +382,6 @@ 0 2 - 1 - 1 @@ -360,8 +402,6 @@ 0 0 - 1 - 1 @@ -408,8 +448,6 @@ 0 0 - 1 - 1 @@ -425,8 +463,6 @@ 0 1 - 1 - 1 @@ -441,16 +477,14 @@ False True - 0 _Text direction: True textflow + 0 0 0 - 1 - 1 @@ -462,16 +496,12 @@ 1 0 - 1 - 1 0 2 - 1 - 1 @@ -496,36 +526,6 @@ - - - - - - - - - - Left-to-right - 0 - - - Right-to-left - 1 - - - Right-to-left (vertical) - 2 - - - Left-to-right (vertical) - 3 - - - Use superordinate object settings - 4 - - - True -- cgit v1.2.3