summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/chrdlg/break.cxx5
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx6
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx9
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx17
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx3
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx2
-rw-r--r--sw/source/ui/fldui/fldvar.cxx2
-rw-r--r--sw/source/ui/frmdlg/cption.cxx3
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx15
-rw-r--r--sw/source/ui/index/cntex.cxx5
-rw-r--r--sw/source/ui/index/cnttab.cxx11
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/ui/misc/docfnote.cxx3
-rw-r--r--sw/source/ui/misc/glossary.cxx15
-rw-r--r--sw/source/ui/misc/insfnote.cxx12
-rw-r--r--sw/source/ui/misc/outline.cxx8
-rw-r--r--sw/source/ui/misc/pggrid.cxx14
-rw-r--r--sw/source/ui/table/tabledlg.cxx3
-rw-r--r--sw/source/ui/utlui/copyfielddlg.cxx58
20 files changed, 157 insertions, 38 deletions
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index e767456266e1..1c5c7753bdb7 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -32,6 +32,7 @@
#include <strings.hrc>
#include <SwStyleNameMapper.hxx>
+#include <names.hxx>
void SwBreakDlg::rememberResult()
{
@@ -171,12 +172,12 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS)
OUString aFormatName;
for (sal_uInt16 i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i)
{
- aFormatName = SwStyleNameMapper::GetUIName( i, aFormatName );
+ aFormatName = SwStyleNameMapper::GetUIName( i, ProgName() );
if (m_xPageCollBox->find_text(aFormatName) == -1)
::InsertStringSorted(u""_ustr, aFormatName, *m_xPageCollBox, 1 );
}
//add landscape page
- aFormatName = SwStyleNameMapper::GetUIName( RES_POOLPAGE_LANDSCAPE, aFormatName );
+ aFormatName = SwStyleNameMapper::GetUIName( RES_POOLPAGE_LANDSCAPE, ProgName() );
if (m_xPageCollBox->find_text(aFormatName) == -1)
::InsertStringSorted(u""_ustr, aFormatName, *m_xPageCollBox, 1);
CheckEnable();
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index d111e2dde19c..d578087bf8f6 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -71,11 +71,11 @@ SwCondCollPage::SwCondCollPage(weld::Container* pPage, weld::DialogController* p
m_xStyleLB->connect_selection_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl));
m_xFilterLB->connect_changed(LINK(this, SwCondCollPage, SelectListBoxHdl));
- std::optional<SfxStyleFamilies> xFamilies(SwModule::get()->CreateStyleFamilies());
- size_t nCount = xFamilies->size();
+ SfxStyleFamilies aFamilies(SwModule::get()->CreateStyleFamilies());
+ size_t nCount = aFamilies.size();
for (size_t j = 0; j < nCount; ++j)
{
- const SfxStyleFamilyItem &rFamilyItem = xFamilies->at(j);
+ const SfxStyleFamilyItem &rFamilyItem = aFamilies.at(j);
if (SfxStyleFamily::Para == rFamilyItem.GetFamily())
{
const SfxStyleFilter& rFilterList = rFamilyItem.GetFilterList();
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 2a960e6a8f01..fea693fe7ffa 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -933,7 +933,11 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
//get the composed document
SwView* pTargetView = xConfigItem->GetTargetView();
- SAL_WARN_IF(!pTargetView, "sw.ui", "No TargetView in SwMailMergeConfigItem");
+ if (!pTargetView)
+ {
+ SAL_WARN("sw.ui", "No TargetView in SwMailMergeConfigItem");
+ return;
+ }
if (xConfigItem->GetMailServer().isEmpty() ||
!SwMailMergeHelper::CheckMailAddress(xConfigItem->GetMailAddress()) )
@@ -945,8 +949,7 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi
sal_uInt16 nRet = xQueryBox->run();
if (RET_YES == nRet )
{
- SwView* pConfigView = pTargetView ? pTargetView : pView;
- SfxAllItemSet aSet(pConfigView->GetPool());
+ SfxAllItemSet aSet(pTargetView->GetPool());
SwMailConfigDlg aDlg(m_xDialog.get(), aSet);
nRet = aDlg.run();
}
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 343dd34850dc..ea4e0ffa3daa 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -93,6 +93,7 @@
#include <mmresultdialogs.hxx>
#include <formatlinebreak.hxx>
#include <translatelangselect.hxx>
+#include <copyfielddlg.hxx>
using namespace css::frame;
using namespace css::uno;
@@ -761,6 +762,22 @@ VclPtr<AbstractSwModalRedlineAcceptDlg> SwAbstractDialogFactory_Impl::CreateSwMo
namespace
{
+class AbstractCopyFieldDlg_Impl
+ : public vcl::AbstractDialogImpl_Async<AbstractCopyFieldDlg, CopyFieldDlg>
+{
+public:
+ using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE;
+};
+}
+
+VclPtr<AbstractCopyFieldDlg> SwAbstractDialogFactory_Impl::CreateCopyFieldDlg(weld::Widget* pParent,
+ const rtl::OUString& rFieldValue)
+{
+ return VclPtr<AbstractCopyFieldDlg_Impl>::Create(pParent, rFieldValue);
+}
+
+namespace
+{
/// Interface implementation for the insert -> fields -> page number wizard dialog
class AbstractSwPageNumberDlg_Impl
: public vcl::AbstractDialogImpl_Async<AbstractSwPageNumberDlg, SwPageNumberDlg>
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index f33460a21840..60879d516887 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -58,6 +58,7 @@
#include <o3tl/deleter.hxx>
#include <pagenumberdlg.hxx>
#include <changedb.hxx>
+#include <copyfielddlg.hxx>
//AbstractDialogFactory_Impl implementations
class SwAbstractDialogFactory_Impl : public SwAbstractDialogFactory
@@ -200,6 +201,8 @@ public:
virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc() override;
virtual GlossarySetActGroup SetGlossaryActGroupFunc() override;
+ virtual VclPtr<AbstractCopyFieldDlg> CreateCopyFieldDlg(weld::Widget* pParent, const rtl::OUString& rFieldValue ) override;
+
// For TabPage
virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) override;
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 16c6cda95b58..92dccb18e1da 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -764,7 +764,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl, weld::Button&, void)
m_rSh.StartAllAction();
m_rSh.StartUndo();
- m_rSh.ResetSelect( nullptr,false );
+ m_rSh.ResetSelect( nullptr,false, ScrollSizeMode::ScrollSizeDefault );
std::unique_ptr<weld::TreeIter> xIter(m_xTree->make_iterator());
if (m_xTree->get_iter_first(*xIter))
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index bdd30be7a443..013c8300106e 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -129,7 +129,7 @@ void SwFieldVarPage::Reset(const SfxItemSet* )
m_xFormatLB->set_size_request(nWidth, nHeight/2);
auto size = m_xValueED->get_widget().get_size_request();
m_xValueED->get_widget().set_size_request(size.getWidth(),
- m_xValueED->get_widget().get_height_rows(5));
+ m_xValueED->get_widget().get_height_rows(6));
const SwField* pCurField = GetCurField();
assert(pCurField && "<SwFieldVarPage::Reset(..)> - <SwField> instance missing!");
nTypeId = pCurField->GetTypeId();
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 292ac69838a2..e0f82eea8211 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -41,6 +41,7 @@
#include <strings.hrc>
#include <SwStyleNameMapper.hxx>
#include <unotxdoc.hxx>
+#include <names.hxx>
using namespace ::com::sun::star;
@@ -191,7 +192,7 @@ SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV)
if( nPoolId )
{
if (sString.isEmpty())
- sString = SwStyleNameMapper::GetUIName(nPoolId, OUString());
+ sString = SwStyleNameMapper::GetUIName(nPoolId, ProgName());
auto nIndex = m_xCategoryBox->find_text(sString);
if (nIndex != -1)
m_xCategoryBox->set_active(nIndex);
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5de4a804bbf0..d4265da6df75 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1351,6 +1351,12 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet)
aSz.SetHeightSizeType(SwFrameSize::Minimum);
bRet |= nullptr != rSet->Put( aSz );
+ if (bRet)
+ {
+ SvxSizeItem aGSz(SID_ATTR_GRAF_FRMSIZE);
+ aGSz.SetSize(aSz.GetSize());
+ bRet |= nullptr != rSet->Put(aGSz);
+ }
}
if (m_xFollowTextFlowCB->get_state_changed_from_saved())
{
@@ -2296,7 +2302,14 @@ void SwFramePage::Init(const SfxItemSet& rSet)
}
}
- const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
+ SwFormatFrameSize rSize = rSet.Get(RES_FRM_SIZE);
+ // size could already have been set from another (Crop) page
+ if (const SvxSizeItem* pSizeItem = rSet.GetItemIfSet(SID_ATTR_GRAF_FRMSIZE, false))
+ {
+ if (pSizeItem->GetSize() != rSize.GetSize())
+ rSize.SetSize(pSizeItem->GetSize());
+ }
+
sal_Int64 nWidth = m_xWidthED->NormalizePercent(rSize.GetWidth());
sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight());
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index b83d453c3844..735f94f7ae11 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -40,6 +40,7 @@
#include <SwStyleNameMapper.hxx>
#include <swuicnttab.hxx>
#include <unoidxcoll.hxx>
+#include <names.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -226,8 +227,8 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_USE_DASH, bool(nIdxOptions & SwTOIOptions::Dash ));
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_USE_UPPER_CASE, bool(nIdxOptions & SwTOIOptions::InitialCaps ));
- OUString aTmpName( SwStyleNameMapper::GetSpecialExtraProgName( rDesc.GetSequenceName() ) );
- lcl_SetProp(xInfo, xIdxProps, UNO_NAME_LABEL_CATEGORY, aTmpName );
+ ProgName aTmpName( SwStyleNameMapper::GetSpecialExtraProgName( rDesc.GetSequenceName() ) );
+ lcl_SetProp(xInfo, xIdxProps, UNO_NAME_LABEL_CATEGORY, aTmpName.toString() );
lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_LABELS, !rDesc.IsCreateFromObjectNames());
sal_Int16 nSet = text::ChapterFormat::NAME_NUMBER;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index e25cfe0d052d..1c1b894fbf29 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -63,6 +63,7 @@
#include <sfx2/filedlghelper.hxx>
#include <toxwrap.hxx>
#include <chpfld.hxx>
+#include <names.hxx>
#include <svtools/editbrowsebox.hxx>
#include <cmath>
@@ -1343,12 +1344,12 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, weld::ComboBox&, rBox, void)
if( nType & TO_ILLUSTRATION )
{
- OUString sName(SwStyleNameMapper::GetUIName(RES_POOLCOLL_LABEL_FIGURE, OUString()));
+ OUString sName(SwStyleNameMapper::GetUIName(RES_POOLCOLL_LABEL_FIGURE, ProgName()));
m_xCaptionSequenceLB->set_active_text(sName);
}
else if( nType & TO_TABLE )
{
- OUString sName(SwStyleNameMapper::GetUIName(RES_POOLCOLL_LABEL_TABLE, OUString()));
+ OUString sName(SwStyleNameMapper::GetUIName(RES_POOLCOLL_LABEL_TABLE, ProgName()));
m_xCaptionSequenceLB->set_active_text(sName);
}
else if( nType & TO_USER )
@@ -1417,6 +1418,8 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, weld::Toggleable&, rButton, void)
m_xUseFFCB->set_sensitive(m_xCollectSameCB->get_active() && !m_xUseDashCB->get_active());
m_xUseDashCB->set_sensitive(m_xCollectSameCB->get_active() && !m_xUseFFCB->get_active());
m_xCaseSensitiveCB->set_sensitive(m_xCollectSameCB->get_active());
+ // tdf#164847 - update menu items based on concordance file presence
+ MenuEnableHdl(*m_xAutoMarkPB);
}
else if (TOX_ILLUSTRATIONS == aCurType.eType
|| TOX_TABLES == aCurType.eType
@@ -1508,6 +1511,8 @@ IMPL_LINK(SwTOXSelectTabPage, MenuExecuteHdl, const OUString&, rIdent, void)
if (RET_OK != aAutoMarkDlg.run() && bNew)
m_sAutoMarkURL = sSaveAutoMarkURL;
}
+ // tdf#164847 - update menu items based on concordance file presence
+ MenuEnableHdl(*m_xAutoMarkPB);
}
class SwTOXWidget
@@ -2739,7 +2744,7 @@ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh)
}
}
m_xMainEntryStyleLB->set_active_text(SwStyleNameMapper::GetUIName(
- RES_POOLCHR_IDX_MAIN_ENTRY, OUString()));
+ RES_POOLCHR_IDX_MAIN_ENTRY, ProgName()));
}
const TranslateId STR_TOKEN_ARY[] =
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 2bc41b0889a4..58a0f1f65621 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -453,7 +453,7 @@ void SwIndexMarkPane::Apply()
{
InsertUpdate();
if(m_bSelected)
- m_pSh->ResetSelect(nullptr, false);
+ m_pSh->ResetSelect(nullptr, false, ScrollSizeMode::ScrollSizeDefault);
}
// apply changes
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index decf3ea80324..f2e8b09427e4 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -348,6 +348,7 @@ void SwInsertBookmarkDlg::PopulateTable()
m_aTableBookmarks.clear();
m_xBookmarksBox->clear();
+ m_rSh.StartAllAction();
IDocumentMarkAccess* const pMarkAccess = m_rSh.getIDocumentMarkAccess();
for (auto ppBookmark = pMarkAccess->getBookmarksBegin();
ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
@@ -358,6 +359,7 @@ void SwInsertBookmarkDlg::PopulateTable()
m_aTableBookmarks.emplace_back(*ppBookmark, (*ppBookmark)->GetName());
}
}
+ m_rSh.EndAllAction();
m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
}
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index a53cbab73814..35c8743ed2a6 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -33,6 +33,7 @@
#include <uitool.hxx>
#include <poolfmt.hxx>
#include <SwStyleNameMapper.hxx>
+#include <names.hxx>
#include <memory>
SwFootNoteOptionDlg::SwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rS)
@@ -195,7 +196,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* )
// page
for (sal_uInt16 i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i)
- m_xPageTemplBox->append_text(SwStyleNameMapper::GetUIName(i, OUString()));
+ m_xPageTemplBox->append_text(SwStyleNameMapper::GetUIName(i, ProgName()));
const size_t nCount = m_pSh->GetPageDescCnt();
for(size_t i = 0; i < nCount; ++i)
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 7a12be03473e..5ecad3698f8b 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -343,8 +343,19 @@ SwGlossaryDlg::SwGlossaryDlg(const SfxViewFrame& rViewFrame,
ShowPreview();
- m_bIsDocReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly() ||
- m_pShell->HasReadonlySel();
+ bool bIsInEditableSect = false;
+ bool bIsReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly();
+ if (bIsReadOnly)
+ {
+ // If there is editable section in read-only mode,
+ // enable the use of the AutoText dialog's insert button
+ // within these sections.
+ const SwSection* pSection = m_pShell->GetCurrSection();
+ if (pSection && pSection->IsEditInReadonly())
+ bIsInEditableSect = true;
+ }
+
+ m_bIsDocReadOnly = (bIsReadOnly || m_pShell->HasReadonlySel()) && !bIsInEditableSect;
if( m_bIsDocReadOnly )
m_xInsertBtn->set_sensitive(false);
m_xNameED->grab_focus();
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index 8e51c4c232b3..a43bd61eacd8 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -50,7 +50,7 @@ void SwInsFootNoteDlg::Apply()
if (m_rSh.SetCurFootnote( aNote ) && m_bExtCharAvailable)
{
m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false );
- SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool());
+ SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(m_rSh.GetAttrPool()));
m_rSh.GetCurAttr(aSet);
const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT );
SvxFontItem aFont( rFont.GetFamily(), m_aFontName,
@@ -58,7 +58,7 @@ void SwInsFootNoteDlg::Apply()
m_eCharSet, RES_CHRATR_FONT );
aSet.Put( aFont );
m_rSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND );
- m_rSh.ResetSelect(nullptr, false);
+ m_rSh.ResetSelect(nullptr, false, ScrollSizeMode::ScrollSizeDefault);
m_rSh.Left(SwCursorSkipMode::Chars, false, 1, false );
}
m_rSh.EndUndo( SwUndoId::END );
@@ -92,7 +92,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl, weld::Button&, void)
{
m_xNumberCharBtn->set_active(true);
- SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool());
+ SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(m_rSh.GetAttrPool()));
m_rSh.GetCurAttr( aSet );
const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT );
@@ -138,7 +138,7 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, weld::Button&, rBtn, void )
Apply();
// go to the next foot/endnote here
- m_rSh.ResetSelect(nullptr, false);
+ m_rSh.ResetSelect(nullptr, false, ScrollSizeMode::ScrollSizeDefault);
if (&rBtn == m_xNextBT.get())
m_rSh.GotoNextFootnoteAnchor();
else
@@ -188,7 +188,7 @@ void SwInsFootNoteDlg::ImplDestroy()
SwViewShell::SetCareDialog(nullptr);
if (m_bEdit)
- m_rSh.ResetSelect(nullptr, false);
+ m_rSh.ResetSelect(nullptr, false, ScrollSizeMode::ScrollSizeDefault);
}
SwInsFootNoteDlg::~SwInsFootNoteDlg()
@@ -212,7 +212,7 @@ void SwInsFootNoteDlg::Init()
sNumStr = aFootnoteNote.GetNumStr();
m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false );
- SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool());
+ SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(m_rSh.GetAttrPool()));
m_rSh.GetCurAttr(aSet);
const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT );
aFont = m_xNumberCharEdit->get_font();
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index eb68def4c6c6..242a7df4fcfa 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -45,6 +45,7 @@
#include <svtools/colorcfg.hxx>
#include <IDocumentOutlineNodes.hxx>
+#include <names.hxx>
using namespace ::com::sun::star;
@@ -170,9 +171,10 @@ SwOutlineTabDialog::SwOutlineTabDialog(weld::Window* pParent, const SfxItemSet*
for( i = 0; i < MAXLEVEL; ++i )
{
// if the style wasn't created yet, it's still at this position
- if( !m_rWrtSh.GetParaStyle( sHeadline =
+ sHeadline =
SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
- sHeadline )) )
+ ProgName() );
+ if( !m_rWrtSh.GetParaStyle( sHeadline ) )
m_aCollNames[i] = sHeadline;
}
@@ -734,7 +736,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
{
m_xCollBox->append_text( SwStyleNameMapper::GetUIName(
- static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
+ static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), ProgName()));
m_xLevelLB->append_text( OUString::number(i + 1) );
}
OUString sStr = "1 - " + OUString::number(MAXLEVEL);
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index d4a97633feb7..743a108e1d73 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -169,9 +169,9 @@ void SwTextGridPage::Reset(const SfxItemSet *rSet)
weld::RadioButton* pButton = nullptr;
switch(rGridItem.GetGridType())
{
- case GRID_NONE : pButton = m_xNoGridRB.get(); break;
- case GRID_LINES_ONLY : pButton = m_xLinesGridRB.get(); break;
- default: pButton = m_xCharsGridRB.get();
+ case SwTextGrid::NONE : pButton = m_xNoGridRB.get(); break;
+ case SwTextGrid::LinesOnly: pButton = m_xLinesGridRB.get(); break;
+ default: pButton = m_xCharsGridRB.get();
}
pButton->set_active(true);
m_xDisplayCB->set_active(rGridItem.IsDisplayGrid());
@@ -225,8 +225,8 @@ DeactivateRC SwTextGridPage::DeactivatePage( SfxItemSet* )
void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
{
SwTextGridItem aGridItem;
- aGridItem.SetGridType(m_xNoGridRB->get_active() ? GRID_NONE :
- m_xLinesGridRB->get_active() ? GRID_LINES_ONLY : GRID_LINES_CHARS );
+ aGridItem.SetGridType(m_xNoGridRB->get_active() ? SwTextGrid::NONE :
+ m_xLinesGridRB->get_active() ? SwTextGrid::LinesOnly : SwTextGrid::LinesAndChars );
aGridItem.SetSnapToChars(m_xSnapToCharsCB->get_active());
aGridItem.SetLines( static_cast< sal_Int32 >(m_xLinesPerPageNF->get_value()) );
aGridItem.SetBaseHeight( static_cast< sal_uInt16 >(
@@ -247,9 +247,9 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
rSet.Put(aGridItem);
SwView * pView = ::GetActiveView();
- if (pView && aGridItem.GetGridType() != GRID_NONE)
+ if (pView && aGridItem.GetGridType() != SwTextGrid::NONE)
{
- if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
+ if ( aGridItem.GetGridType() == SwTextGrid::LinesAndChars )
{
m_bHRulerChanged = true;
}
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index eb680387143c..c2908f22ee59 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -51,6 +51,7 @@
#include <poolfmt.hxx>
#include <swtablerep.hxx>
#include <SwStyleNameMapper.hxx>
+#include <names.hxx>
#include <cmdid.h>
#include <svx/dialogs.hrc>
@@ -1444,7 +1445,7 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
OUString aFormatName;
for (sal_uInt16 i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i)
{
- aFormatName = SwStyleNameMapper::GetUIName(i, aFormatName);
+ aFormatName = SwStyleNameMapper::GetUIName(i, ProgName());
if (m_xPageCollLB->find_text(aFormatName) == -1)
m_xPageCollLB->append_text(aFormatName);
}
diff --git a/sw/source/ui/utlui/copyfielddlg.cxx b/sw/source/ui/utlui/copyfielddlg.cxx
new file mode 100644
index 000000000000..6625f581e451
--- /dev/null
+++ b/sw/source/ui/utlui/copyfielddlg.cxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <copyfielddlg.hxx>
+#include <comphelper/string.hxx>
+
+using namespace ::com::sun::star;
+
+CopyFieldDlg::CopyFieldDlg(weld::Widget* pParent, const rtl::OUString& rFieldValue)
+ : GenericDialogController(pParent, u"modules/swriter/ui/copyfielddialog.ui"_ustr,
+ u"CopyFieldDialog"_ustr)
+ , m_xFieldValueED(new ConditionEdit<weld::TextView>(m_xBuilder->weld_text_view(u"value"_ustr)))
+ , m_xCopy(m_xBuilder->weld_button(u"copy"_ustr))
+ , m_xClose(m_xBuilder->weld_button(u"cancel"_ustr))
+{
+ m_xClose->connect_clicked(LINK(this, CopyFieldDlg, CloseHdl));
+ m_xCopy->connect_clicked(LINK(this, CopyFieldDlg, CopyHdl));
+
+ m_xFieldValueED->set_text(rFieldValue);
+ sal_Int32 nRows{ comphelper::string::getTokenCount(rFieldValue, '\n') };
+
+ m_xFieldValueED->get_widget().set_size_request(
+ m_xFieldValueED->get_widget().get_preferred_size().Width() * 2,
+ m_xFieldValueED->get_widget().get_height_rows(std::min<sal_Int32>(nRows + 1, 6)));
+}
+
+IMPL_LINK_NOARG(CopyFieldDlg, CloseHdl, weld::Button&, void) { m_xDialog->response(RET_OK); }
+
+IMPL_LINK_NOARG(CopyFieldDlg, CopyHdl, weld::Button&, void)
+{
+ int nStartPos;
+ int nEndPos;
+ m_xFieldValueED->get_widget().get_selection_bounds(nStartPos, nEndPos);
+ if (nStartPos == nEndPos)
+ m_xFieldValueED->get_widget().select_region(0, -1);
+
+ m_xFieldValueED->get_widget().copy_clipboard();
+ if (nStartPos == nEndPos)
+ m_xFieldValueED->get_widget().select_region(0, 0);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */