diff options
Diffstat (limited to 'sw/source/ui/envelp/envlop1.cxx')
-rw-r--r-- | sw/source/ui/envelp/envlop1.cxx | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index d01848470f1d..4cd0b1b66040 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -36,8 +36,6 @@ #include <comphelper/string.hxx> -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::container; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; @@ -59,7 +57,7 @@ void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan rRenderContext.SetBackground(rRenderContext.GetSettings().GetStyleSettings().GetDialogColor()); rRenderContext.Erase(); - const SwEnvItem& rItem = m_pDialog->aEnvItem; + const SwEnvItem& rItem = m_pDialog->m_aEnvItem; const tools::Long nPageW = std::max(rItem.m_nWidth, rItem.m_nHeight); const tools::Long nPageH = std::min(rItem.m_nWidth, rItem.m_nHeight); @@ -71,12 +69,12 @@ void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan double(aSize.Height()) / double(nPageH)); Color aBack = rSettings.GetWindowColor(); - Color aFront = SwViewOption::GetFontColor(); - Color aMedium((aBack.GetRed() + aFront.GetRed()) / 2, - (aBack.GetGreen() + aFront.GetGreen()) / 2, - (aBack.GetBlue() + aFront.GetBlue()) / 2); + const Color& rFront = SwViewOption::GetCurrentViewOptions().GetFontColor(); + Color aMedium((aBack.GetRed() + rFront.GetRed()) / 2, + (aBack.GetGreen() + rFront.GetGreen()) / 2, + (aBack.GetBlue() + rFront.GetBlue()) / 2); - rRenderContext.SetLineColor(aFront); + rRenderContext.SetLineColor(rFront); // Envelope const tools::Long nW = static_cast<tools::Long>(f * nPageW); @@ -119,9 +117,9 @@ void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan SwEnvDlg::SwEnvDlg(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, bool bInsert) : SfxTabDialogController(pParent, "modules/swriter/ui/envdialog.ui", "EnvDialog", &rSet) - , aEnvItem(static_cast<const SwEnvItem&>( rSet.Get(FN_ENVELOP))) - , pSh(pWrtSh) - , pPrinter(pPrt) + , m_aEnvItem(static_cast<const SwEnvItem&>( rSet.Get(FN_ENVELOP))) + , m_pSh(pWrtSh) + , m_pPrinter(pPrt) , m_xModify(m_xBuilder->weld_button("modify")) { if (!bInsert) @@ -136,15 +134,15 @@ SwEnvDlg::SwEnvDlg(weld::Window* pParent, const SfxItemSet& rSet, SwEnvDlg::~SwEnvDlg() { - pAddresseeSet.reset(); - pSenderSet.reset(); + m_pAddresseeSet.reset(); + m_pSenderSet.reset(); } -void SwEnvDlg::PageCreated(const OString& rId, SfxTabPage &rPage) +void SwEnvDlg::PageCreated(const OUString& rId, SfxTabPage &rPage) { if (rId == "printer") { - static_cast<SwEnvPrtPage*>(&rPage)->SetPrt(pPrinter); + static_cast<SwEnvPrtPage*>(&rPage)->SetPrt(m_pPrinter); } else if (rId == "envelope") { @@ -162,15 +160,15 @@ short SwEnvDlg::Ok() if (nRet == RET_OK || nRet == RET_USER) { - if (pAddresseeSet) + if (m_pAddresseeSet) { - SwTextFormatColl* pColl = pSh->GetTextCollFromPool(RES_POOLCOLL_ENVELOPE_ADDRESS); - pColl->SetFormatAttr(*pAddresseeSet); + SwTextFormatColl* pColl = m_pSh->GetTextCollFromPool(RES_POOLCOLL_ENVELOPE_ADDRESS); + pColl->SetFormatAttr(*m_pAddresseeSet); } - if (pSenderSet) + if (m_pSenderSet) { - SwTextFormatColl* pColl = pSh->GetTextCollFromPool(RES_POOLCOLL_SEND_ADDRESS); - pColl->SetFormatAttr(*pSenderSet); + SwTextFormatColl* pColl = m_pSh->GetTextCollFromPool(RES_POOLCOLL_SEND_ADDRESS); + pColl->SetFormatAttr(*m_pSenderSet); } } @@ -207,14 +205,14 @@ SwEnvPage::SwEnvPage(weld::Container* pPage, weld::DialogController* pController void SwEnvPage::Init(SwEnvDlg* pDialog) { m_pDialog = pDialog; - m_pSh = m_pDialog->pSh; + m_pSh = m_pDialog->m_pSh; m_aPreview.SetDialog(pDialog); // Install handlers m_xDatabaseLB->connect_changed(LINK(this, SwEnvPage, DatabaseHdl)); m_xTableLB->connect_changed(LINK(this, SwEnvPage, DatabaseHdl)); m_xInsertBT->connect_clicked(LINK(this, SwEnvPage, FieldHdl)); - m_xSenderBox->connect_clicked(LINK(this, SwEnvPage, SenderHdl)); + m_xSenderBox->connect_toggled(LINK(this, SwEnvPage, SenderHdl)); SwDBData aData = m_pSh->GetDBData(); m_sActDBName = aData.sDataSource + OUStringChar(DB_DELIM) + aData.sCommand; @@ -256,10 +254,10 @@ IMPL_LINK_NOARG(SwEnvPage, FieldHdl, weld::Button&, void) m_xAddrEdit->select_region(nStartPos, nEndPos); } -IMPL_LINK_NOARG(SwEnvPage, SenderHdl, weld::Button&, void) +IMPL_LINK_NOARG(SwEnvPage, SenderHdl, weld::Toggleable&, void) { const bool bEnable = m_xSenderBox->get_active(); - GetParentSwEnvDlg()->aEnvItem.m_bSend = bEnable; + GetParentSwEnvDlg()->m_aEnvItem.m_bSend = bEnable; m_xSenderEdit->set_sensitive(bEnable); if (bEnable) { @@ -302,13 +300,13 @@ std::unique_ptr<SfxTabPage> SwEnvPage::Create(weld::Container* pPage, weld::Dial void SwEnvPage::ActivatePage(const SfxItemSet& rSet) { SfxItemSet aSet(rSet); - aSet.Put(GetParentSwEnvDlg()->aEnvItem); + aSet.Put(GetParentSwEnvDlg()->m_aEnvItem); Reset(&aSet); } DeactivateRC SwEnvPage::DeactivatePage(SfxItemSet* _pSet) { - FillItem(GetParentSwEnvDlg()->aEnvItem); + FillItem(GetParentSwEnvDlg()->m_aEnvItem); if( _pSet ) FillItemSet(_pSet); return DeactivateRC::LeavePage; @@ -323,8 +321,8 @@ void SwEnvPage::FillItem(SwEnvItem& rItem) bool SwEnvPage::FillItemSet(SfxItemSet* rSet) { - FillItem(GetParentSwEnvDlg()->aEnvItem); - rSet->Put(GetParentSwEnvDlg()->aEnvItem); + FillItem(GetParentSwEnvDlg()->m_aEnvItem); + rSet->Put(GetParentSwEnvDlg()->m_aEnvItem); return true; } |