Kaydet (Commit) c026ca2a authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwMailMergeLayoutPage

Change-Id: Iae43bcc3c0a94e9eca6d15384afd50d7a9a94c74
Reviewed-on: https://gerrit.libreoffice.org/73263
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 7dc6525f
...@@ -114,7 +114,7 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState) ...@@ -114,7 +114,7 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
SetRoadmapHelpId("modules/swriter/ui/mmsalutationpage/MMSalutationPage"); SetRoadmapHelpId("modules/swriter/ui/mmsalutationpage/MMSalutationPage");
break; break;
case MM_LAYOUTPAGE : case MM_LAYOUTPAGE :
pRet = VclPtr<SwMailMergeLayoutPage>::Create(this); pRet = VclPtr<SwMailMergeLayoutPage>::Create(this, TabPageParent(this));
SetRoadmapHelpId("modules/swriter/ui/mmlayoutpage/MMLayoutPage"); SetRoadmapHelpId("modules/swriter/ui/mmlayoutpage/MMLayoutPage");
break; break;
} }
......
...@@ -75,28 +75,22 @@ using namespace ::com::sun::star::view; ...@@ -75,28 +75,22 @@ using namespace ::com::sun::star::view;
#define DEFAULT_ADDRESS_WIDTH (MM50*15)// 7,5 cm #define DEFAULT_ADDRESS_WIDTH (MM50*15)// 7,5 cm
#define DEFAULT_ADDRESS_HEIGHT (MM50*7) // 3,5cm #define DEFAULT_ADDRESS_HEIGHT (MM50*7) // 3,5cm
SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : SwMailMergeLayoutPage::SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPageParent pParent)
svt::OWizardPage(_pParent, "MMLayoutPage", : svt::OWizardPage(pParent, "modules/swriter/ui/mmlayoutpage.ui", "MMLayoutPage")
"modules/swriter/ui/mmlayoutpage.ui")
, m_pExampleWrtShell(nullptr) , m_pExampleWrtShell(nullptr)
, m_pAddressBlockFormat(nullptr) , m_pAddressBlockFormat(nullptr)
, m_bIsGreetingInserted(false) , m_bIsGreetingInserted(false)
, m_pWizard(_pParent) , m_pWizard(pWizard)
, m_xPosition(m_xBuilder->weld_container("addresspos"))
, m_xAlignToBodyCB(m_xBuilder->weld_check_button("align"))
, m_xLeftFT(m_xBuilder->weld_label("leftft"))
, m_xLeftMF(m_xBuilder->weld_metric_spin_button("left", FieldUnit::CM))
, m_xTopMF(m_xBuilder->weld_metric_spin_button("top", FieldUnit::CM))
, m_xGreetingLine(m_xBuilder->weld_container("greetingspos"))
, m_xUpPB(m_xBuilder->weld_button("up"))
, m_xDownPB(m_xBuilder->weld_button("down"))
, m_xZoomLB(m_xBuilder->weld_combo_box("zoom"))
{ {
get(m_pPosition, "addresspos");
get(m_pGreetingLine, "greetingspos");
get(m_pAlignToBodyCB, "align");
get(m_pLeftFT, "leftft");
get(m_pLeftMF, "left");
get(m_pTopMF, "top");
get(m_pUpPB, "up");
get(m_pDownPB, "down");
get(m_pExampleContainerWIN, "example");
Size aSize(LogicToPixel(Size(124, 159), MapMode(MapUnit::MapAppFont)));
m_pExampleContainerWIN->set_width_request(aSize.Width());
m_pExampleContainerWIN->set_height_request(aSize.Height());
get(m_pZoomLB, "zoom");
std::shared_ptr<const SfxFilter> pSfxFlt = SwIoSystem::GetFilterOfFormat( std::shared_ptr<const SfxFilter> pSfxFlt = SwIoSystem::GetFilterOfFormat(
FILTER_XML, FILTER_XML,
SwDocShell::Factory().GetFilterContainer() ); SwDocShell::Factory().GetFilterContainer() );
...@@ -122,40 +116,39 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : ...@@ -122,40 +116,39 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
uno::Reference< frame::XStorable > xStore( pView->GetDocShell()->GetModel(), uno::UNO_QUERY); uno::Reference< frame::XStorable > xStore( pView->GetDocShell()->GetModel(), uno::UNO_QUERY);
xStore->storeToURL( m_sExampleURL, aValues ); xStore->storeToURL( m_sExampleURL, aValues );
Link<SwOneExampleFrame&,void> aLink(LINK(this, SwMailMergeLayoutPage, PreviewLoadedHdl_Impl)); Link<OneExampleFrame&,void> aLink(LINK(this, SwMailMergeLayoutPage, PreviewLoadedHdl_Impl));
m_pExampleFrame.reset( new SwOneExampleFrame( *m_pExampleContainerWIN, m_xExampleFrame.reset(new OneExampleFrame(EX_SHOW_DEFAULT_PAGE, &aLink, &m_sExampleURL));
EX_SHOW_DEFAULT_PAGE, &aLink, &m_sExampleURL ) ); m_xExampleContainerWIN.reset(new weld::CustomWeld(*m_xBuilder, "example", *m_xExampleFrame));
Size aSize = m_xExampleFrame->GetDrawingArea()->get_ref_device().LogicToPixel(
Size(124, 159), MapMode(MapUnit::MapAppFont));
m_xExampleFrame->set_size_request(aSize.Width(), aSize.Height());
m_pExampleContainerWIN->Show(false); m_xExampleContainerWIN->hide();
m_pLeftMF->SetValue(m_pLeftMF->Normalize(DEFAULT_LEFT_DISTANCE), FieldUnit::TWIP); m_xLeftMF->set_value(m_xLeftMF->normalize(DEFAULT_LEFT_DISTANCE), FieldUnit::TWIP);
m_pTopMF->SetValue(m_pTopMF->Normalize(DEFAULT_TOP_DISTANCE), FieldUnit::TWIP); m_xTopMF->set_value(m_xTopMF->normalize(DEFAULT_TOP_DISTANCE), FieldUnit::TWIP);
const LanguageTag& rLang = Application::GetSettings().GetUILanguageTag(); const LanguageTag& rLang = Application::GetSettings().GetUILanguageTag();
m_pZoomLB->InsertEntry(unicode::formatPercent(50, rLang), 1); m_xZoomLB->append_text(unicode::formatPercent(50, rLang));
m_pZoomLB->InsertEntry(unicode::formatPercent(75, rLang), 2); m_xZoomLB->append_text(unicode::formatPercent(75, rLang));
m_pZoomLB->InsertEntry(unicode::formatPercent(100, rLang), 3); m_xZoomLB->append_text(unicode::formatPercent(100, rLang));
m_pZoomLB->SelectEntryPos(0); //page size m_xZoomLB->set_active(0); //page size
m_pZoomLB->SetSelectHdl(LINK(this, SwMailMergeLayoutPage, ZoomHdl_Impl)); m_xZoomLB->connect_changed(LINK(this, SwMailMergeLayoutPage, ZoomHdl_Impl));
Link<SpinField&,void> aFrameHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressHdl_Impl); Link<weld::MetricSpinButton&,void> aFrameHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressHdl_Impl);
Link<Control&,void> aFocusHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl); m_xLeftMF->connect_value_changed(aFrameHdl);
m_pLeftMF->SetUpHdl(aFrameHdl); m_xTopMF->connect_value_changed(aFrameHdl);
m_pLeftMF->SetDownHdl(aFrameHdl);
m_pLeftMF->SetLoseFocusHdl(aFocusHdl);
m_pTopMF->SetUpHdl(aFrameHdl);
m_pTopMF->SetDownHdl(aFrameHdl);
m_pTopMF->SetLoseFocusHdl(aFocusHdl);
FieldUnit eFieldUnit = ::GetDfltMetric(false); FieldUnit eFieldUnit = ::GetDfltMetric(false);
::SetFieldUnit( *m_pLeftMF, eFieldUnit ); ::SetFieldUnit( *m_xLeftMF, eFieldUnit );
::SetFieldUnit( *m_pTopMF, eFieldUnit ); ::SetFieldUnit( *m_xTopMF, eFieldUnit );
Link<Button*,void> aUpDownHdl = LINK(this, SwMailMergeLayoutPage, GreetingsHdl_Impl ); Link<weld::Button&,void> aUpDownHdl = LINK(this, SwMailMergeLayoutPage, GreetingsHdl_Impl );
m_pUpPB->SetClickHdl(aUpDownHdl); m_xUpPB->connect_clicked(aUpDownHdl);
m_pDownPB->SetClickHdl(aUpDownHdl); m_xDownPB->connect_clicked(aUpDownHdl);
m_pAlignToBodyCB->SetClickHdl(LINK(this, SwMailMergeLayoutPage, AlignToTextHdl_Impl)); m_xAlignToBodyCB->connect_toggled(LINK(this, SwMailMergeLayoutPage, AlignToTextHdl_Impl));
m_pAlignToBodyCB->Check(); m_xAlignToBodyCB->set_active(true);
} }
SwMailMergeLayoutPage::~SwMailMergeLayoutPage() SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
...@@ -165,18 +158,7 @@ SwMailMergeLayoutPage::~SwMailMergeLayoutPage() ...@@ -165,18 +158,7 @@ SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
void SwMailMergeLayoutPage::dispose() void SwMailMergeLayoutPage::dispose()
{ {
m_pExampleFrame.reset();
File::remove( m_sExampleURL ); File::remove( m_sExampleURL );
m_pPosition.clear();
m_pAlignToBodyCB.clear();
m_pLeftFT.clear();
m_pLeftMF.clear();
m_pTopMF.clear();
m_pGreetingLine.clear();
m_pUpPB.clear();
m_pDownPB.clear();
m_pExampleContainerWIN.clear();
m_pZoomLB.clear();
m_pWizard.clear(); m_pWizard.clear();
svt::OWizardPage::dispose(); svt::OWizardPage::dispose();
} }
...@@ -187,10 +169,10 @@ void SwMailMergeLayoutPage::ActivatePage() ...@@ -187,10 +169,10 @@ void SwMailMergeLayoutPage::ActivatePage()
bool bGreetingLine = rConfigItem.IsGreetingLine(false) && !rConfigItem.IsGreetingInserted(); bool bGreetingLine = rConfigItem.IsGreetingLine(false) && !rConfigItem.IsGreetingInserted();
bool bAddressBlock = rConfigItem.IsAddressBlock() && !rConfigItem.IsAddressInserted(); bool bAddressBlock = rConfigItem.IsAddressBlock() && !rConfigItem.IsAddressInserted();
m_pPosition->Enable(bAddressBlock); m_xPosition->set_sensitive(bAddressBlock);
AlignToTextHdl_Impl(m_pAlignToBodyCB); AlignToTextHdl_Impl(*m_xAlignToBodyCB);
m_pGreetingLine->Enable(bGreetingLine); m_xGreetingLine->set_sensitive(bGreetingLine);
//check if greeting and/or address frame have to be inserted/removed //check if greeting and/or address frame have to be inserted/removed
if(m_pExampleWrtShell) // initially there's nothing to check if(m_pExampleWrtShell) // initially there's nothing to check
...@@ -222,15 +204,15 @@ void SwMailMergeLayoutPage::ActivatePage() ...@@ -222,15 +204,15 @@ void SwMailMergeLayoutPage::ActivatePage()
} }
else else
{ {
long nLeft = static_cast< long >(m_pLeftMF->Denormalize(m_pLeftMF->GetValue(FieldUnit::TWIP))); long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
long nTop = static_cast< long >(m_pTopMF->Denormalize(m_pTopMF->GetValue(FieldUnit::TWIP))); long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
m_pAddressBlockFormat = InsertAddressFrame( m_pAddressBlockFormat = InsertAddressFrame(
*m_pExampleWrtShell, m_pWizard->GetConfigItem(), *m_pExampleWrtShell, m_pWizard->GetConfigItem(),
Point(nLeft, nTop), Point(nLeft, nTop),
m_pAlignToBodyCB->IsChecked(), true); m_xAlignToBodyCB->get_active(), true);
} }
} }
m_xExampleFrame->Invalidate();
} }
} }
...@@ -240,13 +222,13 @@ bool SwMailMergeLayoutPage::commitPage(::svt::WizardTypes::CommitPageReason eRea ...@@ -240,13 +222,13 @@ bool SwMailMergeLayoutPage::commitPage(::svt::WizardTypes::CommitPageReason eRea
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
if (eReason == ::svt::WizardTypes::eTravelForward || eReason == ::svt::WizardTypes::eFinish) if (eReason == ::svt::WizardTypes::eTravelForward || eReason == ::svt::WizardTypes::eFinish)
{ {
long nLeft = static_cast< long >(m_pLeftMF->Denormalize(m_pLeftMF->GetValue(FieldUnit::TWIP))); long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
long nTop = static_cast< long >(m_pTopMF->Denormalize(m_pTopMF->GetValue(FieldUnit::TWIP))); long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
InsertAddressAndGreeting( InsertAddressAndGreeting(
m_pWizard->GetSwView(), m_pWizard->GetSwView(),
rConfigItem, rConfigItem,
Point(nLeft, nTop), Point(nLeft, nTop),
m_pAlignToBodyCB->IsChecked()); m_xAlignToBodyCB->get_active());
} }
return true; return true;
} }
...@@ -623,11 +605,11 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig ...@@ -623,11 +605,11 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
OSL_ENSURE(nullptr == rShell.GetTableFormat(), "What to do with a table here?"); OSL_ENSURE(nullptr == rShell.GetTableFormat(), "What to do with a table here?");
} }
IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame&, void) IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, OneExampleFrame&, void)
{ {
m_pExampleContainerWIN->Show(); m_xExampleContainerWIN->show();
Reference< XModel > & xModel = m_pExampleFrame->GetModel(); Reference< XModel > & xModel = m_xExampleFrame->GetModel();
//now the ViewOptions should be set properly //now the ViewOptions should be set properly
Reference< XViewSettingsSupplier > xSettings(xModel->getCurrentController(), UNO_QUERY); Reference< XViewSettingsSupplier > xSettings(xModel->getCurrentController(), UNO_QUERY);
m_xViewProperties = xSettings->getViewSettings(); m_xViewProperties = xSettings->getViewSettings();
...@@ -645,7 +627,7 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame& ...@@ -645,7 +627,7 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame&
m_pAddressBlockFormat = InsertAddressFrame( m_pAddressBlockFormat = InsertAddressFrame(
*m_pExampleWrtShell, rConfigItem, *m_pExampleWrtShell, rConfigItem,
Point(DEFAULT_LEFT_DISTANCE, DEFAULT_TOP_DISTANCE), Point(DEFAULT_LEFT_DISTANCE, DEFAULT_TOP_DISTANCE),
m_pAlignToBodyCB->IsChecked(), true); m_xAlignToBodyCB->get_active(), true);
} }
if(rConfigItem.IsGreetingLine(false)) if(rConfigItem.IsGreetingLine(false))
{ {
...@@ -653,23 +635,21 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame& ...@@ -653,23 +635,21 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame&
m_bIsGreetingInserted = true; m_bIsGreetingInserted = true;
} }
Any aZoom; ZoomHdl_Impl(*m_xZoomLB);
aZoom <<= sal_Int16(DocumentZoomType::ENTIRE_PAGE);
m_xViewProperties->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
const SwFormatFrameSize& rPageSize = m_pExampleWrtShell->GetPageDesc( const SwFormatFrameSize& rPageSize = m_pExampleWrtShell->GetPageDesc(
m_pExampleWrtShell->GetCurPageDesc()).GetMaster().GetFrameSize(); m_pExampleWrtShell->GetCurPageDesc()).GetMaster().GetFrameSize();
m_pLeftMF->SetMax(rPageSize.GetWidth() - DEFAULT_LEFT_DISTANCE); m_xLeftMF->set_max(rPageSize.GetWidth() - DEFAULT_LEFT_DISTANCE, FieldUnit::NONE);
m_pTopMF->SetMax(rPageSize.GetHeight() - DEFAULT_TOP_DISTANCE); m_xTopMF->set_max(rPageSize.GetHeight() - DEFAULT_TOP_DISTANCE, FieldUnit::NONE);
} }
IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox&, rBox, void) IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, weld::ComboBox&, rBox, void)
{ {
if(m_pExampleWrtShell) if (m_pExampleWrtShell)
{ {
sal_Int16 eType = DocumentZoomType::BY_VALUE; sal_Int16 eType = DocumentZoomType::BY_VALUE;
short nZoom = 50; short nZoom = 50;
switch(rBox.GetSelectedEntryPos()) switch (rBox.get_active())
{ {
case 0 : eType = DocumentZoomType::ENTIRE_PAGE; break; case 0 : eType = DocumentZoomType::ENTIRE_PAGE; break;
case 1 : nZoom = 50; break; case 1 : nZoom = 50; break;
...@@ -682,35 +662,33 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox&, rBox, void) ...@@ -682,35 +662,33 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox&, rBox, void)
aZoom <<= nZoom; aZoom <<= nZoom;
m_xViewProperties->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom); m_xViewProperties->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
m_xExampleFrame->Invalidate();
} }
} }
IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl, Control&, void) IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, weld::MetricSpinButton&, void)
{
ChangeAddressHdl_Impl(*m_pLeftMF);
}
IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, SpinField&, void)
{ {
if(m_pExampleWrtShell && m_pAddressBlockFormat) if(m_pExampleWrtShell && m_pAddressBlockFormat)
{ {
long nLeft = static_cast< long >(m_pLeftMF->Denormalize(m_pLeftMF->GetValue(FieldUnit::TWIP))); long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
long nTop = static_cast< long >(m_pTopMF->Denormalize(m_pTopMF->GetValue(FieldUnit::TWIP))); long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
SfxItemSet aSet( SfxItemSet aSet(
m_pExampleWrtShell->GetAttrPool(), m_pExampleWrtShell->GetAttrPool(),
svl::Items<RES_VERT_ORIENT, RES_ANCHOR>{}); svl::Items<RES_VERT_ORIENT, RES_ANCHOR>{});
if(m_pAlignToBodyCB->IsChecked()) if (m_xAlignToBodyCB->get_active())
aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA ));
else else
aSet.Put(SwFormatHoriOrient( nLeft, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME )); aSet.Put(SwFormatHoriOrient( nLeft, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
aSet.Put(SwFormatVertOrient( nTop, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); aSet.Put(SwFormatVertOrient( nTop, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ));
m_pExampleWrtShell->GetDoc()->SetFlyFrameAttr( *m_pAddressBlockFormat, aSet ); m_pExampleWrtShell->GetDoc()->SetFlyFrameAttr( *m_pAddressBlockFormat, aSet );
m_xExampleFrame->Invalidate();
} }
} }
IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, Button*, pButton, void) IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, weld::Button&, rButton, void)
{ {
bool bDown = pButton == m_pDownPB; bool bDown = &rButton == m_xDownPB.get();
bool bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 ); bool bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 );
if (bMoved || bDown) if (bMoved || bDown)
m_pWizard->GetConfigItem().MoveGreeting(bDown ? 1 : -1 ); m_pWizard->GetConfigItem().MoveGreeting(bDown ? 1 : -1 );
...@@ -719,14 +697,15 @@ IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, Button*, pButton, void) ...@@ -719,14 +697,15 @@ IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, Button*, pButton, void)
//insert a new paragraph before the greeting line //insert a new paragraph before the greeting line
m_pExampleWrtShell->SplitNode(); m_pExampleWrtShell->SplitNode();
} }
m_xExampleFrame->Invalidate();
} }
IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, Button*, pBox, void) IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, weld::ToggleButton&, rBox, void)
{ {
bool bCheck = static_cast<CheckBox*>(pBox)->IsChecked() && pBox->IsEnabled(); bool bCheck = rBox.get_active() && rBox.get_sensitive();
m_pLeftFT->Enable(!bCheck); m_xLeftFT->set_sensitive(!bCheck);
m_pLeftMF->Enable(!bCheck); m_xLeftMF->set_sensitive(!bCheck);
ChangeAddressHdl_Impl( *m_pLeftMF ); ChangeAddressHdl_Impl( *m_xLeftMF );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
class SwMailMergeWizard; class SwMailMergeWizard;
class SwFrameFormat; class SwFrameFormat;
class SwOneExampleFrame; class OneExampleFrame;
class SwWrtShell; class SwWrtShell;
class SwView; class SwView;
...@@ -37,22 +37,6 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySe ...@@ -37,22 +37,6 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySe
class SwMailMergeLayoutPage : public svt::OWizardPage class SwMailMergeLayoutPage : public svt::OWizardPage
{ {
VclPtr<VclContainer> m_pPosition;
VclPtr<CheckBox> m_pAlignToBodyCB;
VclPtr<FixedText> m_pLeftFT;
VclPtr<MetricField> m_pLeftMF;
VclPtr<MetricField> m_pTopMF;
VclPtr<VclContainer> m_pGreetingLine;
VclPtr<PushButton> m_pUpPB;
VclPtr<PushButton> m_pDownPB;
VclPtr<vcl::Window> m_pExampleContainerWIN;
VclPtr<ListBox> m_pZoomLB;
std::unique_ptr<SwOneExampleFrame> m_pExampleFrame;
SwWrtShell* m_pExampleWrtShell; SwWrtShell* m_pExampleWrtShell;
OUString m_sExampleURL; OUString m_sExampleURL;
...@@ -64,12 +48,23 @@ class SwMailMergeLayoutPage : public svt::OWizardPage ...@@ -64,12 +48,23 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
css::uno::Reference< css::beans::XPropertySet > m_xViewProperties; css::uno::Reference< css::beans::XPropertySet > m_xViewProperties;
DECL_LINK(PreviewLoadedHdl_Impl, SwOneExampleFrame&, void); std::unique_ptr<weld::Container> m_xPosition;
DECL_LINK(ZoomHdl_Impl, ListBox&, void); std::unique_ptr<weld::CheckButton> m_xAlignToBodyCB;
DECL_LINK(ChangeAddressHdl_Impl, SpinField&, void); std::unique_ptr<weld::Label> m_xLeftFT;
DECL_LINK(ChangeAddressLoseFocusHdl_Impl, Control&, void); std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
DECL_LINK(GreetingsHdl_Impl, Button*, void); std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
DECL_LINK(AlignToTextHdl_Impl, Button*, void); std::unique_ptr<weld::Container> m_xGreetingLine;
std::unique_ptr<weld::Button> m_xUpPB;
std::unique_ptr<weld::Button> m_xDownPB;
std::unique_ptr<weld::ComboBox> m_xZoomLB;
std::unique_ptr<OneExampleFrame> m_xExampleFrame;
std::unique_ptr<weld::CustomWeld> m_xExampleContainerWIN;
DECL_LINK(PreviewLoadedHdl_Impl, OneExampleFrame&, void);
DECL_LINK(ZoomHdl_Impl, weld::ComboBox&, void);
DECL_LINK(ChangeAddressHdl_Impl, weld::MetricSpinButton&, void);
DECL_LINK(GreetingsHdl_Impl, weld::Button&, void);
DECL_LINK(AlignToTextHdl_Impl, weld::ToggleButton&, void);
static SwFrameFormat* InsertAddressFrame( static SwFrameFormat* InsertAddressFrame(
SwWrtShell& rShell, SwWrtShell& rShell,
...@@ -82,7 +77,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage ...@@ -82,7 +77,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
virtual void ActivatePage() override; virtual void ActivatePage() override;
virtual bool commitPage(::svt::WizardTypes::CommitPageReason _eReason) override; virtual bool commitPage(::svt::WizardTypes::CommitPageReason _eReason) override;
public: public:
SwMailMergeLayoutPage( SwMailMergeWizard* _pParent); SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPageParent pParent);
virtual ~SwMailMergeLayoutPage() override; virtual ~SwMailMergeLayoutPage() override;
virtual void dispose() override; virtual void dispose() override;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 --> <!-- Generated with glade 3.22.1 -->
<interface domain="sw"> <interface domain="sw">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
<property name="step_increment">1</property> <property name="step_increment">1</property>
<property name="page_increment">10</property> <property name="page_increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">999.99000000000001</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkBox" id="MMLayoutPage"> <object class="GtkBox" id="MMLayoutPage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -70,22 +75,21 @@ ...@@ -70,22 +75,21 @@
<object class="GtkLabel" id="label6"> <object class="GtkLabel" id="label6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="mmlayoutpage|label6">_From top</property> <property name="label" translatable="yes" context="mmlayoutpage|label6">_From top</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">top:0.00cm</property> <property name="mnemonic_widget">top</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkSpinButton" id="top:0.00cm"> <object class="GtkSpinButton" id="top">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="text" translatable="yes" context="mmlayoutpage|top">2.00</property> <property name="text" translatable="yes" context="mmlayoutpage|top">2.00</property>
<property name="adjustment">adjustment1</property> <property name="adjustment">adjustment1</property>
<property name="digits">2</property> <property name="digits">2</property>
...@@ -94,16 +98,12 @@ ...@@ -94,16 +98,12 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -124,8 +124,6 @@ ...@@ -124,8 +124,6 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -134,19 +132,18 @@ ...@@ -134,19 +132,18 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<child> <child>
<object class="GtkSpinButton" id="left:0.00cm"> <object class="GtkSpinButton" id="left">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="text" translatable="no">2.00</property> <property name="activates_default">True</property>
<property name="adjustment">adjustment1</property> <property name="text">2.00</property>
<property name="adjustment">adjustment2</property>
<property name="digits">2</property> <property name="digits">2</property>
<property name="value">2</property> <property name="value">2</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -159,10 +156,10 @@ ...@@ -159,10 +156,10 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property> <property name="margin_left">12</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="mmlayoutpage|leftft">From _left</property> <property name="label" translatable="yes" context="mmlayoutpage|leftft">From _left</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">left:0.00cm</property> <property name="mnemonic_widget">left</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
...@@ -174,24 +171,18 @@ ...@@ -174,24 +171,18 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -212,8 +203,6 @@ ...@@ -212,8 +203,6 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -238,32 +227,28 @@ ...@@ -238,32 +227,28 @@
<object class="GtkLabel" id="label4"> <object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="mmlayoutpage|label4">Move</property> <property name="label" translatable="yes" context="mmlayoutpage|label4">Move</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">up</property> <property name="mnemonic_widget">up</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label5"> <object class="GtkLabel" id="label5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="mmlayoutpage|label5">Move</property> <property name="label" translatable="yes" context="mmlayoutpage|label5">Move</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">down</property> <property name="mnemonic_widget">down</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -277,8 +262,6 @@ ...@@ -277,8 +262,6 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -292,8 +275,6 @@ ...@@ -292,8 +275,6 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -314,16 +295,12 @@ ...@@ -314,16 +295,12 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -343,16 +320,14 @@ ...@@ -343,16 +320,14 @@
<object class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="mmlayoutpage|label7">_Zoom</property> <property name="label" translatable="yes" context="mmlayoutpage|label7">_Zoom</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">zoom</property> <property name="mnemonic_widget">zoom</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -366,42 +341,54 @@ ...@@ -366,42 +341,54 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="example"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="orientation">vertical</property> <property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child> <child>
<placeholder/> <object class="GtkDrawingArea" id="example">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="example-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="mmlayoutpage|example-atkobject">Preview</property>
</object>
</child>
</object>
</child>
</object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
......
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