summaryrefslogtreecommitdiff
path: root/sw/source/ui/envelp/label1.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-23 13:25:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-26 12:37:12 +0200
commitea1dde9e899dc26f0b877ff5fc5f8d027769521b (patch)
tree55fc839c326b8dcb757b9987e25c94f75a5df753 /sw/source/ui/envelp/label1.cxx
parent6440f3cd504a0aa1f9522a4be60dc382cf9eef52 (diff)
weld SwLabPreview
Change-Id: I710eacd28f3b6c38890145cf82eeca8bec6ae1f6 Reviewed-on: https://gerrit.libreoffice.org/53328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/envelp/label1.cxx')
-rw-r--r--sw/source/ui/envelp/label1.cxx32
1 files changed, 17 insertions, 15 deletions
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 6ff18b882716..e3537834932f 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -272,21 +272,6 @@ SwLabPage::SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pTypeBox->SetSelectHdl(LINK(this, SwLabPage, TypeHdl ));
InitDatabaseBox();
-
- size_t nLstGroup = 0;
-
- const size_t nCount = GetParentSwLabDlg()->Makes().size();
- for(size_t i = 0; i < nCount; ++i)
- {
- OUString& rStr = GetParentSwLabDlg()->Makes()[i];
- m_pMakeBox->InsertEntry( rStr );
-
- if ( rStr == aItem.m_aLstMake)
- nLstGroup = i;
- }
-
- m_pMakeBox->SelectEntryPos( nLstGroup );
- m_pMakeBox->GetSelectHdl().Call(*m_pMakeBox);
}
SwLabPage::~SwLabPage()
@@ -526,6 +511,23 @@ bool SwLabPage::FillItemSet(SfxItemSet* rSet)
void SwLabPage::Reset(const SfxItemSet* rSet)
{
+ m_pMakeBox->Clear();
+
+ size_t nLstGroup = 0;
+
+ const size_t nCount = GetParentSwLabDlg()->Makes().size();
+ for(size_t i = 0; i < nCount; ++i)
+ {
+ OUString& rStr = GetParentSwLabDlg()->Makes()[i];
+ m_pMakeBox->InsertEntry( rStr );
+
+ if ( rStr == aItem.m_aLstMake)
+ nLstGroup = i;
+ }
+
+ m_pMakeBox->SelectEntryPos( nLstGroup );
+ m_pMakeBox->GetSelectHdl().Call(*m_pMakeBox);
+
aItem = static_cast<const SwLabItem&>( rSet->Get(FN_LABEL));
OUString sDBName = aItem.m_sDBName;