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

weld SvxObjectTitleDescDialog

Change-Id: Id08c201ee4377fe84618906725e7699d29dc1160
Reviewed-on: https://gerrit.libreoffice.org/51395Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 04caeef4
......@@ -426,8 +426,9 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
VclPtr<ChartWindow> pChartWindow( m_pChartController->GetChartWindow() );
ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
pFact->CreateSvxObjectTitleDescDialog( aTitle, aDescription ) );
pFact->CreateSvxObjectTitleDescDialog(pChartWindow ? pChartWindow->GetFrameWeld() : nullptr, aTitle, aDescription ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
pDlg->GetTitle( aTitle );
......
......@@ -79,37 +79,22 @@ IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl, weld::Entry&, void)
// #i68101#
// Dialog for editing Object Title and Description
SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
vcl::Window* pWindow,
const OUString& rTitle,
const OUString& rDescription) :
ModalDialog ( pWindow, "ObjectTitleDescDialog", "cui/ui/objecttitledescdialog.ui" )
SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle,
const OUString& rDescription)
: GenericDialogController(pParent, "cui/ui/objecttitledescdialog.ui", "ObjectTitleDescDialog")
, m_xEdtTitle(m_xBuilder->weld_entry("object_title_entry"))
, m_xEdtDescription(m_xBuilder->weld_text_view("desc_entry"))
{
get(pEdtTitle, "object_title_entry");
get(pEdtDescription, "desc_entry");
//lock height to initial height
pEdtDescription->set_height_request(pEdtDescription->get_preferred_size().Height());
m_xEdtDescription->set_size_request(-1, m_xEdtDescription->get_text_height() * 5);
// set title & desc
pEdtTitle->SetText(rTitle);
pEdtDescription->SetText(rDescription);
m_xEdtTitle->set_text(rTitle);
m_xEdtDescription->set_text(rDescription);
// activate title
pEdtTitle->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
m_xEdtTitle->select_region(0, -1);
}
SvxObjectTitleDescDialog::~SvxObjectTitleDescDialog()
{
disposeOnce();
}
void SvxObjectTitleDescDialog::dispose()
{
pEdtTitle.clear();
pEdtDescription.clear();
ModalDialog::dispose();
}
/*************************************************************************
|*
|* dialog for cancelling, saving or adding
......
......@@ -127,7 +127,10 @@ short AbstractSvxObjectNameDialog_Impl::Execute()
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl);
short AbstractSvxObjectTitleDescDialog_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSvxPathSelectDialog_Impl);
......@@ -621,12 +624,12 @@ IMPL_LINK_NOARG(AbstractSvxObjectNameDialog_Impl, CheckNameHdl, SvxObjectNameDia
void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(OUString& rTitle)
{
pDlg->GetTitle(rTitle);
rTitle = m_xDlg->GetTitle();
}
void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(OUString& rDescription)
{
pDlg->GetDescription(rDescription);
rDescription = m_xDlg->GetDescription();
}
OUString AbstractSvxMultiPathDialog_Impl::GetPath() const
......@@ -1112,9 +1115,9 @@ VclPtr<AbstractSvxObjectNameDialog> AbstractDialogFactory_Impl::CreateSvxObjectN
return VclPtr<AbstractSvxObjectNameDialog_Impl>::Create(new SvxObjectNameDialog(pParent, rName));
}
VclPtr<AbstractSvxObjectTitleDescDialog> AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription)
VclPtr<AbstractSvxObjectTitleDescDialog> AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription)
{
return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(VclPtr<SvxObjectTitleDescDialog>::Create(nullptr, rTitle, rDescription));
return VclPtr<AbstractSvxObjectTitleDescDialog_Impl>::Create(new SvxObjectTitleDescDialog(pParent, rTitle, rDescription));
}
VclPtr<AbstractSvxMultiPathDialog> AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(vcl::Window* pParent)
......
......@@ -344,7 +344,14 @@ private:
class AbstractSvxObjectTitleDescDialog_Impl :public AbstractSvxObjectTitleDescDialog
{
DECL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl, SvxObjectTitleDescDialog)
protected:
std::unique_ptr<SvxObjectTitleDescDialog> m_xDlg;
public:
explicit AbstractSvxObjectTitleDescDialog_Impl(SvxObjectTitleDescDialog* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
virtual void GetTitle(OUString& rName) override;
virtual void GetDescription(OUString& rName) override;
};
......@@ -574,7 +581,7 @@ public:
const OUString& rName, const OUString& rDesc) override;
// #i68101#
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override;
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription) override;
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) override;
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(vcl::Window* pParent) override;
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(vcl::Window* pParent) override;
......
......@@ -102,23 +102,21 @@ public:
/** #i68101#
Dialog for editing Object Title and Description */
class SvxObjectTitleDescDialog : public ModalDialog
class SvxObjectTitleDescDialog : public weld::GenericDialogController
{
private:
// title
VclPtr<Edit> pEdtTitle;
std::unique_ptr<weld::Entry> m_xEdtTitle;
// description
VclPtr<VclMultiLineEdit> pEdtDescription;
std::unique_ptr<weld::TextView> m_xEdtDescription;
public:
// constructor
SvxObjectTitleDescDialog(vcl::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
virtual ~SvxObjectTitleDescDialog() override;
virtual void dispose() override;
SvxObjectTitleDescDialog(weld::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
// data access
void GetTitle(OUString& rTitle) {rTitle = pEdtTitle->GetText(); }
void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
OUString GetTitle() const { return m_xEdtTitle->get_text(); }
OUString GetDescription() const { return m_xEdtDescription->get_text(); }
};
enum class SvxMessDialogButton {
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.2 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkTextBuffer" id="textbuffer1">
......@@ -13,6 +13,9 @@
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="objecttitledescdialog|ObjectTitleDescDialog">Description</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox5">
......@@ -86,10 +89,10 @@
<object class="GtkLabel" id="object_title_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="objecttitledescdialog|object_title_label">_Title:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">object_title_entry</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -102,6 +105,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
<property name="width_chars">55</property>
</object>
<packing>
......@@ -114,9 +118,9 @@
<object class="GtkLabel" id="desc_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="objecttitledescdialog|desc_label">_Description:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -130,7 +134,7 @@
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="desc_entry:border">
<object class="GtkTextView" id="desc_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="wrap_mode">word</property>
......@@ -158,5 +162,8 @@
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -403,7 +403,7 @@ public:
// #i68101#
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(const OUString& rTitle, const OUString& rDescription) = 0;
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) = 0;
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxMultiPathDialog(vcl::Window* pParent) = 0 ;
virtual VclPtr<AbstractSvxMultiPathDialog> CreateSvxPathSelectDialog(vcl::Window* pParent) = 0 ;
......
......@@ -558,7 +558,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
vcl::Window* pWin = pViewData->GetActiveWin();
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(
pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aDescription));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if(RET_OK == pDlg->Execute())
......
......@@ -1282,8 +1282,7 @@ public:
// Show warning that the orientation could not be set.
if (pViewShell)
{
vcl::Window* pWin = pViewShell->GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pViewShell->GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::OkCancel,
SdResId(STR_WARN_PRINTFORMAT_FAILURE)));
xWarn->set_default_response(RET_CANCEL);
......
......@@ -433,8 +433,7 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt
{
if (IsPresObjSelected(false))
{
vcl::Window* pWin = mpDrawViewShell->GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(mpDrawViewShell->GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
......
This diff is collapsed.
......@@ -105,8 +105,7 @@ void DrawViewShell::DeleteActualLayer()
// replace placeholder
aString = aString.replaceFirst("$", rName);
vcl::Window* pWin = GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
aString));
if (xQueryBox->run() == RET_YES)
......
......@@ -324,17 +324,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 &&
!mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
{
::sd::Window* pWindow = GetActiveWindow();
if ( mpDrawView->IsPresObjSelected() )
{
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
}
else
{
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER)));
if (xQueryBox->run() == RET_YES )
......@@ -368,17 +367,16 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if ( nMarkCnt > 0 && !b3DObjMarked &&
(!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
{
::sd::Window* pWindow = GetActiveWindow();
if ( mpDrawView->IsPresObjSelected() )
{
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
}
else
{
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Question, VclButtonsType::YesNo,
SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER)));
if (xQueryBox->run() == RET_YES)
......@@ -683,8 +681,7 @@ void DrawViewShell::FuDeleteSelectedObjects()
// placeholders which cannot be deleted selected
if (mpDrawView->IsPresObjSelected(false, true, false, true))
{
::sd::Window* pWindow = GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
......@@ -796,8 +793,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
{
if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
......@@ -821,8 +817,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
{
if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow ? pWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SdResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
......
......@@ -377,8 +377,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
if( !mpViewSh )
return;
vcl::Window* pWindow = mpViewSh->GetActiveWindow();
SfxErrorContext aEc( ERRCTX_ERROR, pWindow ? pWindow->GetFrameWeld() : nullptr, RID_SO_ERRCTX );
SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetFrameWeld(), RID_SO_ERRCTX );
ErrCode nError = ERRCODE_NONE;
::std::vector< OUString >::const_iterator aIter( maDropFileVector.begin() );
......
......@@ -717,8 +717,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
{
ErrCode aErrCode = ERRCODE_NONE;
vcl::Window* pWindow = GetActiveWindow();
SfxErrorContext aEC(ERRCTX_SO_DOVERB, pWindow ? pWindow->GetFrameWeld() : nullptr, RID_SO_ERRCTX);
SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetFrameWeld(), RID_SO_ERRCTX);
bool bAbort = false;
GetDocSh()->SetWaitCursor( true );
SfxViewShell* pViewShell = GetViewShell();
......
......@@ -321,7 +321,7 @@ bool SwGlossaryHdl::NewGlossary(const OUString& rName, const OUString& rShortNam
rCfg.IsSaveRelFile(), pOnlyText );
if(nSuccess == sal_uInt16(-1) )
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWrtShell->GetView().GetWindow()->GetFrameWeld(),
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWrtShell->GetView().GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok, SwResId(STR_ERR_INSERT_GLOS)));
xBox->run();
}
......@@ -477,8 +477,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName,
}
OUString aTmp( SwResId(STR_NOGLOS));
aTmp = aTmp.replaceFirst("%1", aShortName);
vcl::Window* pWin = pWrtShell->GetView().GetWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWrtShell->GetView().GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
aTmp));
xInfoBox->run();
......
......@@ -515,8 +515,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
vcl::Window* pWin = GetView().GetWindow();
ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, aName));
ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
OSL_ENSURE(pDlg, "Dialog creation failed!");
pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, CheckGroupShapeNameHdl));
......@@ -546,7 +545,8 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
aTitle, aDescription));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if(RET_OK == pDlg->Execute())
......
......@@ -635,9 +635,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
OUString aName(rSh.GetFlyName());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
assert(pFact);
vcl::Window* pWin = GetView().GetWindow();
ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(
pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, aName));
pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
assert(pDlg);
......@@ -663,8 +662,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
assert(pFact);
ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
pFact->CreateSvxObjectTitleDescDialog( aTitle,
aDescription ));
pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
aTitle, aDescription ));
assert(pDlg);
if ( pDlg->Execute() == RET_OK )
......
......@@ -158,10 +158,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
short nState = RET_CANCEL;
if (aGraphicAttr != GraphicAttr()) // the image has been modified
{
vcl::Window* pWin = GetView().GetWindow();
weld::Window* pWin = GetView().GetFrameWeld();
if (pWin)
{
nState = GraphicHelper::HasToSaveTransformedImage(pWin->GetFrameWeld());
nState = GraphicHelper::HasToSaveTransformedImage(pWin);
}
}
else
......
......@@ -763,8 +763,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
break;
case TableMergeErr::TooComplex:
{
vcl::Window* pWin = GetView().GetWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetView().GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SwResId(STR_ERR_TABLE_MERGE)));
xInfoBox->run();
......@@ -827,7 +826,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(GetView().GetViewFrame()->GetWindow().GetFrameWeld(), &rSh));
ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(pFact->CreateSwAutoFormatDlg(GetView().GetFrameWeld(), &rSh));
OSL_ENSURE(pDlg, "Dialog creation failed!");
pDlg->Execute();
break;
......@@ -949,8 +948,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline())
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
vcl::Window* pWin = GetView().GetWindow();
ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg(pFact ? pFact->CreateSvxInsRowColDlg(pWin ? pWin->GetFrameWeld() : nullptr,
ScopedVclPtr<SvxAbstractInsRowColDlg> pDlg(pFact ? pFact->CreateSvxInsRowColDlg(GetView().GetFrameWeld(),
nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : nullptr);
if( pDlg.get() && (pDlg->Execute() == 1) )
......@@ -990,8 +988,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
if( pFact )
{
const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY;
vcl::Window* pWin = GetView().GetWindow();
ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog(pWin ? pWin->GetFrameWeld() : nullptr, rSh.IsTableVertical(), nMaxVert));
ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert));
if( pDlg && (pDlg->Execute() == RET_OK) )
{
nCount = pDlg->GetCount();
......@@ -1036,8 +1033,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
vcl::Window* pWin = GetView().GetWindow();
ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(pWin ? pWin->GetFrameWeld() : nullptr, rSh));
ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(GetView().GetFrameWeld(), rSh));
OSL_ENSURE(pDlg, "Dialog creation failed!");
pDlg->Execute();
rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, static_cast<sal_uInt16>(pDlg->GetSplitMode()) ) );
......
......@@ -228,8 +228,7 @@ ErrCode SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
const sal_uInt16 aRotation = aMetadata.getRotation();
if (aRotation != 0)
{
vcl::Window* pWin = GetWindow();
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr, "modules/swriter/ui/queryrotateintostandarddialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/queryrotateintostandarddialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryRotateIntoStandardOrientationDialog"));
if (xQueryBox->run() == RET_YES)
{
......@@ -428,9 +427,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
// really store as link only?
if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
{
vcl::Window* pWin = GetWindow();
SvxLinkWarningDialog aWarnDlg(pWin ? pWin->GetFrameWeld() : nullptr, pFileDlg->GetPath());
if(aWarnDlg.run() != RET_OK)
SvxLinkWarningDialog aWarnDlg(GetFrameWeld(), pFileDlg->GetPath());
if (aWarnDlg.run() != RET_OK)
bAsLink=false; // don't store as link
}
}
......@@ -485,8 +483,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
{
if( bShowError )
{
vcl::Window* pWin = GetWindow();
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SwResId(pResId)));
xInfoBox->run();
......@@ -563,8 +560,7 @@ void SwView::Execute(SfxRequest &rReq)
{
OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
// xmlsec05: new password dialog
weld::Window* pParent = GetViewFrame()->GetWindow().GetFrameWeld();
SfxPasswordDialog aPasswdDlg(pParent);
SfxPasswordDialog aPasswdDlg(GetFrameWeld());
aPasswdDlg.SetMinLen(1);
//#i69751# the result of Execute() can be ignored
(void)aPasswdDlg.execute();
......@@ -604,8 +600,7 @@ void SwView::Execute(SfxRequest &rReq)
// xmlsec05: new password dialog
// message box for wrong password
weld::Window* pParent = GetViewFrame()->GetWindow().GetFrameWeld();
SfxPasswordDialog aPasswdDlg(pParent);
SfxPasswordDialog aPasswdDlg(GetFrameWeld());
aPasswdDlg.SetMinLen(1);
if (!aPasswd.getLength())
aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM);
......@@ -2286,7 +2281,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
if ( lcl_NeedAdditionalDataSource( xDBContext ) )
{
// no data sources are available - create a new one
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewFrame()->GetWindow().GetFrameWeld(), "modules/swriter/ui/datasourcesunavailabledialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/datasourcesunavailabledialog.ui"));
std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("DataSourcesUnavailableDialog"));
// no cancel allowed
if (RET_OK != xQuery->run())
......@@ -2334,7 +2329,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
OUString sSource;
if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetViewFrame()->GetWindow().GetFrameWeld(), "modules/swriter/ui/warndatasourcedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/warndatasourcedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog("WarnDataSourceDialog"));
OUString sTmp(xWarning->get_primary_text());
xWarning->set_primary_text(sTmp.replaceFirst("%1", sSource));
......
......@@ -2423,6 +2423,15 @@ public:
{
}
virtual void set_size_request(int nWidth, int nHeight) override
{
GtkWidget* pParent = gtk_widget_get_parent(m_pWidget);
if (GTK_IS_SCROLLED_WINDOW(pParent))
gtk_widget_set_size_request(pParent, nWidth, nHeight);
else
gtk_widget_set_size_request(m_pWidget, nWidth, nHeight);
}
virtual void set_text(const OUString& rText) override
{
GtkTextBuffer* pBuffer = gtk_text_view_get_buffer(m_pTextView);
......
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