[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sw/inc sw/source sw/uiconfig xmloff/source
Bernhard Widl
bernhard.widl at cib.de
Thu Jan 11 00:51:59 UTC 2018
Rebased ref, commits from common ancestor:
commit 93949cb1a1f8d7273cbc7e956a1b6309ddf88d92
Author: Bernhard Widl <bernhard.widl at cib.de>
Date: Wed Nov 15 19:30:28 2017 +0100
tdf#101856 create bookmarks w/ new hidden/cond attrs, save as odt
Change-Id: Ibf067f7862d9d70d00d2e45ab0fcf74ec2fe1175
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index a132b6a3c0a4..aa9854c41475 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -86,6 +86,10 @@ namespace sw { namespace mark
virtual const vcl::KeyCode& GetKeyCode() const =0;
virtual void SetShortName(const OUString&) =0;
virtual void SetKeyCode(const vcl::KeyCode&) =0;
+ virtual bool IsHidden() const =0;
+ virtual const OUString& GetHideCondition() const =0;
+ virtual void Hide(bool hide) =0;
+ virtual void SetHideCondition(const OUString&) =0;
private:
IBookmark(IBookmark&) = delete;
IBookmark &operator =(IBookmark const&) = delete;
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 09cd1f48513c..36a93cef8ba7 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -814,6 +814,8 @@
#define FN_PARAM_PAM (FN_PARAM2+27) /* Point and Mark */
#define FN_TEXT_BOX (FN_PARAM2+28) /* TextBox Property*/
#define FN_PARAM_IGNORE_PROTECTED (FN_PARAM2+29) /* Ignore protected areas */
+#define FN_BOOKMARK_HIDDEN (FN_PARAM2+30) /* Hidden Property of bookmarks*/
+#define FN_BOOKMARK_CONDITION (FN_PARAM2+31) /* Condition Property of bookmarks*/
// Status: not more than 19!
#define FN_STAT_PAGE (FN_STAT + 1)
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 89c90a965cfd..8195259686eb 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -549,6 +549,11 @@ public:
const OUString& rName,
const OUString& rShortName,
IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::MarkType::BOOKMARK);
+ ::sw::mark::IMark* SetBookmark(
+ const vcl::KeyCode&,
+ const OUString& rName,
+ bool rHide,
+ const OUString& rCondition);
bool GotoMark( const ::sw::mark::IMark* const pMark ); // sets CurrentCursor.SPoint
bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart );
bool GoNextBookmark(); // true, if there was one
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index 1959e52720cb..7d7f9909bed2 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -210,6 +210,8 @@
#define SID_FAX_LIST (RC_GLOBALS_BEGIN + 116)
#define SID_WRT_SHELL (RC_GLOBALS_BEGIN + 117)
+#define STR_BOOKMARK_HIDDEN (RC_GLOBALS_BEGIN + 118)
+#define STR_BOOKMARK_CONDITION (RC_GLOBALS_BEGIN + 119)
#endif
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 63589f273ce5..c700ee3bb468 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -331,6 +331,8 @@
#define UNO_NAME_IS_GLOBAL_DOCUMENT_SECTION "IsGlobalDocumentSection"
#define UNO_NAME_TEXT_FIELD "TextField"
#define UNO_NAME_BOOKMARK "Bookmark"
+#define UNO_NAME_BOOKMARK_HIDDEN "BookmarkHidden"
+#define UNO_NAME_BOOKMARK_CONDITION "BookmarkCondition"
#define UNO_NAME_TEXT_TABLE "TextTable"
#define UNO_NAME_CELL "Cell"
#define UNO_NAME_TEXT_FRAME "TextFrame"
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 08594bc3d0e8..cd74c7adf102 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -286,6 +286,7 @@ namespace sw { namespace mark
, ::sfx2::Metadatable()
, m_aCode(rCode)
, m_sShortName(rShortName)
+ , m_bHidden(false)
{
m_aName = rName;
}
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 946af35c5cae..d95eb1174d65 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -99,6 +99,31 @@ namespace
}
// set CurrentCursor.SPoint
+// at CurrentCursor.SPoint
+::sw::mark::IMark* SwCursorShell::SetBookmark(
+ const vcl::KeyCode& rCode,
+ const OUString& rName,
+ bool rHide,
+ const OUString& rCondition)
+{
+ StartAction();
+ ::sw::mark::IMark* pMark = getIDocumentMarkAccess()->makeMark(
+ *GetCursor(),
+ rName,
+ IDocumentMarkAccess::MarkType::BOOKMARK);
+ ::sw::mark::IBookmark* pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(pMark);
+ if (pBookmark)
+ {
+ pBookmark->SetKeyCode(rCode);
+ pBookmark->SetShortName(OUString());
+ pBookmark->Hide(rHide);
+ pBookmark->SetHideCondition(rCondition);
+ }
+ EndAction();
+ return pMark;
+}
+// set CurrentCursor.SPoint
+
bool SwCursorShell::GotoMark(const ::sw::mark::IMark* const pMark, bool bAtStart)
{
// watch Cursor-Moves
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index ac5fae6a37db..cdb4a8422419 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -178,6 +178,14 @@ namespace sw {
{ m_sShortName = rShortName; }
virtual void SetKeyCode(const vcl::KeyCode& rCode) override
{ m_aCode = rCode; }
+ virtual bool IsHidden() const override
+ { return m_bHidden; }
+ virtual const OUString& GetHideCondition() const override
+ { return m_sHideCondition; }
+ virtual void Hide(bool rHide) override
+ { m_bHidden = rHide; }
+ virtual void SetHideCondition(const OUString& rHideCondition) override
+ { m_sHideCondition = rHideCondition; }
// ::sfx2::Metadatable
virtual ::sfx2::IXmlIdRegistry& GetRegistry() override;
@@ -189,6 +197,8 @@ namespace sw {
private:
vcl::KeyCode m_aCode;
OUString m_sShortName;
+ bool m_bHidden;
+ OUString m_sHideCondition;
};
class Fieldmark
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index feca7d3cdee8..58397c3b843f 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -52,13 +52,16 @@ public:
::comphelper::OInterfaceContainerHelper2 m_EventListeners;
SwDoc * m_pDoc;
::sw::mark::IMark * m_pRegisteredBookmark;
- OUString m_sMarkName;
+ OUString m_sMarkName;
+ bool m_bHidden;
+ OUString m_HideCondition;
Impl( SwDoc *const pDoc, ::sw::mark::IMark *const /*pBookmark*/)
: SwClient()
, m_EventListeners(m_Mutex)
, m_pDoc(pDoc)
, m_pRegisteredBookmark(nullptr)
+ , m_bHidden(false)
{
// DO NOT registerInMark here! (because SetXBookmark would delete rThis)
}
@@ -106,6 +109,14 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark & rThis,
else if (m_pRegisteredBookmark)
{
m_sMarkName = m_pRegisteredBookmark->GetName();
+
+ // the following applies only to bookmarks (not to fieldmarks)
+ IBookmark* pBookmark = dynamic_cast<IBookmark*>(m_pRegisteredBookmark);
+ if (pBookmark)
+ {
+ m_bHidden = pBookmark->IsHidden();
+ m_HideCondition = pBookmark->GetHideCondition();
+ }
m_pRegisteredBookmark->Remove(this);
}
m_pRegisteredBookmark = pBkmk;
@@ -408,11 +419,46 @@ SwXBookmark::getPropertySetInfo() throw (uno::RuntimeException, std::exception)
void SAL_CALL
SwXBookmark::setPropertyValue(const OUString& PropertyName,
- const uno::Any& /*rValue*/)
+ const uno::Any& rValue)
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException, std::exception)
{
+ if (PropertyName == UNO_NAME_BOOKMARK_HIDDEN)
+ {
+ bool bNewValue = false;
+ if (!(rValue >>= bNewValue))
+ throw lang::IllegalArgumentException("Property BookmarkHidden requires value of type boolean", nullptr, 0);
+
+ IBookmark* pBookmark = dynamic_cast<IBookmark*>(m_pImpl->m_pRegisteredBookmark);
+ if (pBookmark)
+ {
+ pBookmark->Hide(bNewValue);
+ }
+ else
+ {
+ m_pImpl->m_bHidden = bNewValue;
+ }
+ return;
+ }
+ else if (PropertyName == UNO_NAME_BOOKMARK_CONDITION)
+ {
+ OUString newValue;
+ if (!(rValue >>= newValue))
+ throw lang::IllegalArgumentException("Property BookmarkCondition requires value of type string", nullptr, 0);
+
+ IBookmark* pBookmark = dynamic_cast<IBookmark*>(m_pImpl->m_pRegisteredBookmark);
+ if (pBookmark)
+ {
+ pBookmark->SetHideCondition(newValue);
+ }
+ else
+ {
+ m_pImpl->m_HideCondition = newValue;
+ }
+ return;
+ }
+
// nothing to set here
throw lang::IllegalArgumentException("Property is read-only: "
+ PropertyName, static_cast< cppu::OWeakObject * >(this), 0 );
@@ -431,6 +477,30 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
{
aRet <<= getName();
}
+ else if (rPropertyName == UNO_NAME_BOOKMARK_HIDDEN)
+ {
+ IBookmark* pBookmark = dynamic_cast<IBookmark*>(m_pImpl->m_pRegisteredBookmark);
+ if (pBookmark)
+ {
+ aRet <<= pBookmark->IsHidden();
+ }
+ else
+ {
+ aRet <<= m_pImpl->m_bHidden;
+ }
+ }
+ else if (rPropertyName == UNO_NAME_BOOKMARK_CONDITION)
+ {
+ IBookmark* pBookmark = dynamic_cast<IBookmark*>(m_pImpl->m_pRegisteredBookmark);
+ if (pBookmark)
+ {
+ aRet <<= pBookmark->GetHideCondition();
+ }
+ else
+ {
+ aRet <<= m_pImpl->m_HideCondition;
+ }
+ }
}
return aRet;
}
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index bdf5820168ff..6e236d7613f6 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -952,6 +952,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetBookmarkPropertyMap
{
{ OUString(UNO_LINK_DISPLAY_NAME), FN_PARAM_LINK_DISPLAY_NAME, cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0xff},
COMMON_TEXT_CONTENT_PROPERTIES
+ { OUString(UNO_NAME_BOOKMARK_HIDDEN), FN_BOOKMARK_HIDDEN, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
+ { OUString(UNO_NAME_BOOKMARK_CONDITION), FN_BOOKMARK_CONDITION, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 625399a349b3..af046949a7ea 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -208,7 +208,7 @@ IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, RenameHdl, Button*, void)
IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, InsertHdl, Button*, void)
{
OUString sBookmark = m_pEditBox->GetText();
- rSh.SetBookmark(vcl::KeyCode(), sBookmark, OUString());
+ rSh.SetBookmark(vcl::KeyCode(), sBookmark, m_pHideCB->IsChecked(), m_pConditionED->GetText());
rReq.AppendItem(SfxStringItem(FN_INSERT_BOOKMARK, sBookmark));
rReq.Done();
if (!rReq.IsDone())
@@ -217,6 +217,13 @@ IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, InsertHdl, Button*, void)
EndDialog(RET_OK);
}
+IMPL_LINK_TYPED(SwInsertBookmarkDlg, ChangeHideHdl, Button *, pBox, void)
+{
+ bool bHide = static_cast<CheckBox*>(pBox)->IsChecked();
+ m_pConditionED->Enable(bHide);
+ m_pConditionFT->Enable(bHide);
+}
+
void SwInsertBookmarkDlg::GotoSelectedBookmark()
{
if (!ValidateBookmarks())
@@ -304,6 +311,9 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, S
get(m_pDeleteBtn, "delete");
get(m_pGotoBtn, "goto");
get(m_pRenameBtn, "rename");
+ get(m_pHideCB, "hide");
+ get(m_pConditionFT, "condlabel");
+ get(m_pConditionED, "withcond");
m_pBookmarksBox = VclPtr<BookmarkTable>::Create(*m_pBookmarksContainer);
@@ -315,6 +325,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rS, S
m_pDeleteBtn->SetClickHdl(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
m_pGotoBtn->SetClickHdl(LINK(this, SwInsertBookmarkDlg, GotoHdl));
m_pRenameBtn->SetClickHdl(LINK(this, SwInsertBookmarkDlg, RenameHdl));
+ m_pHideCB->SetClickHdl(LINK(this, SwInsertBookmarkDlg, ChangeHideHdl));
m_pDeleteBtn->Disable();
m_pGotoBtn->Disable();
@@ -341,35 +352,44 @@ void SwInsertBookmarkDlg::dispose()
m_pDeleteBtn.clear();
m_pGotoBtn.clear();
m_pEditBox.clear();
+ m_pRenameBtn.clear();
+ m_pHideCB.clear();
+ m_pConditionFT.clear();
+ m_pConditionED.clear();
SvxStandardDialog::dispose();
}
BookmarkTable::BookmarkTable(SvSimpleTableContainer& rParent) :
SvSimpleTable(rParent, 0)
{
- static long nTabs[] = {3, 0, 40, 150};
+ static long nTabs[] = { 5, 0, 40, 150, 300, 340 };
SetTabs(nTabs, MAP_PIXEL);
SetSelectionMode(MULTIPLE_SELECTION);
InsertHeaderEntry(OUString(SW_RES(STR_PAGE)));
InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_NAME)));
InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_TEXT)));
+ InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_HIDDEN)));
+ InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_CONDITION)));
rParent.SetTable(this);
}
void BookmarkTable::InsertBookmark(sw::mark::IMark* pMark)
{
- OUString sBookmarkNodeText = pMark->GetMarkStart().nNode.GetNode().GetTextNode()->GetText();
- sal_Int32 nBookmarkNodeTextPos = pMark->GetMarkStart().nContent.GetIndex();
+ sw::mark::IBookmark* pBookmark = dynamic_cast<sw::mark::IBookmark*>(pMark);
+ assert(pBookmark);
+
+ OUString sBookmarkNodeText = pBookmark->GetMarkStart().nNode.GetNode().GetTextNode()->GetText();
+ sal_Int32 nBookmarkNodeTextPos = pBookmark->GetMarkStart().nContent.GetIndex();
sal_Int32 nBookmarkTextLen = 0;
bool bPulledAll = false;
bool bPulling = false;
static const sal_Int32 nMaxTextLen = 50;
- if (pMark->IsExpanded())
+ if (pBookmark->IsExpanded())
{
- nBookmarkTextLen = pMark->GetMarkEnd().nContent.GetIndex() - nBookmarkNodeTextPos;
+ nBookmarkTextLen = pBookmark->GetMarkEnd().nContent.GetIndex() - nBookmarkNodeTextPos;
}
else
{
@@ -390,8 +410,12 @@ void BookmarkTable::InsertBookmark(sw::mark::IMark* pMark)
else if (bPulling && !bPulledAll)
sBookmarkNodeText = "..." + sBookmarkNodeText;
+ OUString sHidden = "No";
+ if (pBookmark->IsHidden())
+ sHidden = "Yes";
+ OUString sHideCondition = pBookmark->GetHideCondition();
OUString sPageNum = OUString::number(SwPaM(pMark->GetMarkStart()).GetPageNum());
- OUString sColumnData = sPageNum + "\t" + pMark->GetName() + "\t" + sBookmarkNodeText;
+ OUString sColumnData = sPageNum + "\t" + pBookmark->GetName() + "\t" + sBookmarkNodeText + "\t" + sHidden + "\t" + sHideCondition;
InsertEntryToColumn(sColumnData, TREELIST_APPEND, 0xffff, pMark);
}
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx
index 472cedb2bb64..9ca724b69578 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -24,6 +24,7 @@
#include <ndtxt.hxx>
#include <vcl/button.hxx>
+#include <condedit.hxx>
#include <svtools/simptabl.hxx>
#include <pam.hxx>
@@ -57,6 +58,9 @@ class SwInsertBookmarkDlg: public SvxStandardDialog
VclPtr<PushButton> m_pDeleteBtn;
VclPtr<PushButton> m_pGotoBtn;
VclPtr<PushButton> m_pRenameBtn;
+ VclPtr<CheckBox> m_pHideCB;
+ VclPtr<FixedText> m_pConditionFT;
+ VclPtr<ConditionEdit> m_pConditionED;
OUString sRemoveWarning;
SwWrtShell& rSh;
SfxRequest& rReq;
@@ -70,6 +74,7 @@ class SwInsertBookmarkDlg: public SvxStandardDialog
DECL_LINK_TYPED(GotoHdl, Button*, void);
DECL_LINK_TYPED(SelectionChangedHdl, SvTreeListBox*, void);
DECL_LINK_TYPED(DoubleClickHdl, SvTreeListBox*, bool);
+ DECL_LINK_TYPED(ChangeHideHdl, Button *, void);
// Fill table with bookmarks
void PopulateTable();
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui b/sw/uiconfig/swriter/ui/insertbookmark.ui
index 412dfe620be1..f292427a4d3d 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
-<interface>
+<!-- Generated with glade 3.20.0 -->
+<interface domain="sw">
<requires lib="gtk+" version="3.0"/>
+ <requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="InsertBookmarkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -26,30 +27,17 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="pack_type">start</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButtonBox" id="box5">
+ <object class="GtkButton" id="insert">
+ <property name="label" translatable="yes" context="insertbookmark|insert">Insert</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkButton" id="insert">
- <property name="label" translatable="yes">Insert</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -66,16 +54,69 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="hide">
+ <property name="label" translatable="yes" context="insertbookmark|hide">H_ide</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="condlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="insertbookmark|condlabel">_With condition</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="swlo-ConditionEdit" id="withcond">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="svtlo-SvSimpleTableContainer" id="bookmarks">
<property name="width_request">350</property>
<property name="height_request">250</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -84,92 +125,25 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkButtonBox" id="box4">
+ <object class="GtkButton" id="goto">
+ <property name="label" translatable="yes" context="insertbookmark|goto">Go to</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkButton" id="help">
- <property name="label">gtk-help</property>
- <property name="width_request">75</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="pack_type">start</property>
+ <property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButtonBox" id="box4">
+ <object class="GtkButton" id="delete">
+ <property name="label" translatable="yes" context="insertbookmark|delete">Delete</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="homogeneous">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkButton" id="rename">
- <property name="label" translatable="yes">Rename</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="delete">
- <property name="label" translatable="yes">Delete</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="goto">
- <property name="label" translatable="yes">Go to</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="close">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -178,11 +152,65 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="rename">
+ <property name="label" translatable="yes" context="insertbookmark|rename">Rename</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child internal-child="action_area" id="dialog-action_area1">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 462f655d642f..41bd0d503898 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2529,6 +2529,30 @@ void XMLTextParagraphExport::exportTextMark(
GetExport().AddAttributesRDFa(xTextContent);
}
+ // bookmark-start: add attributes hidden and condition
+ if (nElement == 1)
+ {
+ Reference<XPropertySet> bkmkProps(rPropSet->getPropertyValue(rProperty), UNO_QUERY);
+ Reference<XPropertySetInfo> bkmkPropInfo(bkmkProps->getPropertySetInfo(), UNO_QUERY);
+ OUString sHidden("BookmarkHidden");
+ if (bkmkPropInfo->hasPropertyByName(sHidden))
+ {
+ bool bHidden = false;
+ bkmkProps->getPropertyValue(sHidden) >>= bHidden;
+ if (bHidden)
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "hidden", "true");
+ OUString sCondition("BookmarkCondition");
+ if (bkmkPropInfo->hasPropertyByName(sCondition))
+ {
+ OUString sBookmarkCondition;
+ bkmkProps->getPropertyValue(sCondition) >>= sBookmarkCondition;
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "condition", sBookmarkCondition);
+ }
+ }
+ }
+ }
+
// export element
DBG_ASSERT(pElements != nullptr, "illegal element array");
DBG_ASSERT(nElement >= 0, "illegal element number");
More information about the Libreoffice-commits
mailing list