Kaydet (Commit) 61ff1d91 authored tarafından Gulsah Kose's avatar Gulsah Kose Kaydeden (comit) Gülşah Köse

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: 's avatarGulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/38176Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 182a62e0
......@@ -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)) );
......
......@@ -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;
......
......@@ -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())
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment