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

weld SwAsciiFilterDlg and set an explicit parent for the dialog

Change-Id: Ie2a52a9e2ea7f41a336b227de670cd5f688d7cd4
Reviewed-on: https://gerrit.libreoffice.org/52778Tested-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 34d362b5
......@@ -170,6 +170,7 @@ public:
void SelectEntryPos(int nPos) { m_xControl->set_active(nPos); }
void connect_changed(const Link<weld::ComboBoxText&, void>& rLink) { m_aChangeHdl = rLink; }
void hide() { m_xControl->hide(); }
};
class SVX_DLLPUBLIC SvxLanguageComboBox : public ComboBox, public SvxLanguageBoxBase
......
......@@ -20,6 +20,7 @@
#define INCLUDED_SVX_TXENCBOX_HXX
#include <vcl/lstbox.hxx>
#include <vcl/weld.hxx>
#include <rtl/textenc.h>
#include <svx/svxdllapi.h>
......@@ -88,6 +89,75 @@ public:
rtl_TextEncoding GetSelectTextEncoding() const;
};
class SVX_DLLPUBLIC TextEncodingBox
{
private:
std::unique_ptr<weld::ComboBoxText> m_xControl;
public:
TextEncodingBox(weld::ComboBoxText* pControl);
~TextEncodingBox();
/** Fill with all known encodings but exclude those matching one or more
given flags as defined in rtl/tencinfo.h
<p> If nButIncludeInfoFlags is given, encodings are included even if they
match nExcludeInfoFlags. Thus it is possible to exclude 16/32-bit
Unicode with RTL_TEXTENCODING_INFO_UNICODE but to include UTF7 and UTF8
with RTL_TEXTENCODING_INFO_MIME </p>
@param bExcludeImportSubsets
If <TRUE/>, some specific encodings are not listed, as they are a
subset of another encoding. This is the case for
RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK,
RTL_TEXTENCODING_MS_936, which are covered by
RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to
<TRUE/> whenever the box is used in import dialogs. */
void FillFromTextEncodingTable(
bool bExcludeImportSubsets,
sal_uInt32 nExcludeInfoFlags = 0,
sal_uInt32 nButIncludeInfoFlags = 0
);
/** Fill with all encodings known to the dbtools::OCharsetMap but exclude
those matching one or more given flags as defined in rtl/tencinfo.h
<p> If nButIncludeInfoFlags is given, encodings are included even if they
match nExcludeInfoFlags. Thus it is possible to exclude 16/32-bit
Unicode with RTL_TEXTENCODING_INFO_UNICODE but to include UTF7 and UTF8
with RTL_TEXTENCODING_INFO_MIME </p>
@param bExcludeImportSubsets
If <TRUE/>, some specific encodings are not listed, as they are a
subset of another encoding. This is the case for
RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK,
RTL_TEXTENCODING_MS_936, which are covered by
RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to
<TRUE/> whenever the box is used in import dialogs. */
void FillFromDbTextEncodingMap(
bool bExcludeImportSubsets,
sal_uInt32 nExcludeInfoFlags = 0
);
/** Fill with all known MIME encodings and select the best according to
<method>GetBestMimeEncoding</method>
*/
void FillWithMimeAndSelectBest();
void InsertTextEncoding( const rtl_TextEncoding nEnc );
void InsertTextEncoding( const rtl_TextEncoding nEnc,
const OUString& rEntry );
void SelectTextEncoding( const rtl_TextEncoding nEnc );
rtl_TextEncoding GetSelectTextEncoding() const;
void connect_changed(const Link<weld::ComboBoxText&, void>& rLink) { m_xControl->connect_changed(rLink); }
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -223,4 +223,154 @@ void SvxTextEncodingBox::SelectTextEncoding( const rtl_TextEncoding nEnc )
SelectEntryPos( nAt );
}
TextEncodingBox::TextEncodingBox(weld::ComboBoxText* pControl)
: m_xControl(pControl)
{
}
TextEncodingBox::~TextEncodingBox()
{
}
void TextEncodingBox::FillFromTextEncodingTable(
bool bExcludeImportSubsets, sal_uInt32 nExcludeInfoFlags,
sal_uInt32 nButIncludeInfoFlags )
{
rtl_TextEncodingInfo aInfo;
aInfo.StructSize = sizeof(rtl_TextEncodingInfo);
const sal_uInt32 nCount = SAL_N_ELEMENTS(RID_SVXSTR_TEXTENCODING_TABLE);
for (sal_uInt32 j = 0; j < nCount; ++j)
{
bool bInsert = true;
rtl_TextEncoding nEnc = RID_SVXSTR_TEXTENCODING_TABLE[j].second;
if ( nExcludeInfoFlags )
{
if ( !rtl_getTextEncodingInfo( nEnc, &aInfo ) )
bInsert = false;
else
{
if ( (aInfo.Flags & nExcludeInfoFlags) == 0 )
{
if ( (nExcludeInfoFlags & RTL_TEXTENCODING_INFO_UNICODE) &&
((nEnc == RTL_TEXTENCODING_UCS2) ||
nEnc == RTL_TEXTENCODING_UCS4) )
bInsert = false; // InfoFlags don't work for Unicode :-(
}
else if ( (aInfo.Flags & nButIncludeInfoFlags) == 0 )
bInsert = false;
}
}
if ( bInsert )
{
if ( bExcludeImportSubsets )
{
switch ( nEnc )
{
// subsets of RTL_TEXTENCODING_GB_18030
case RTL_TEXTENCODING_GB_2312 :
case RTL_TEXTENCODING_GBK :
case RTL_TEXTENCODING_MS_936 :
bInsert = false;
break;
}
}
if ( bInsert )
InsertTextEncoding(nEnc, SvxResId(RID_SVXSTR_TEXTENCODING_TABLE[j].first));
}
}
}
void TextEncodingBox::FillFromDbTextEncodingMap(
bool bExcludeImportSubsets, sal_uInt32 nExcludeInfoFlags )
{
#if !HAVE_FEATURE_DBCONNECTIVITY
(void)bExcludeImportSubsets;
(void)nExcludeInfoFlags;
#else
rtl_TextEncodingInfo aInfo;
aInfo.StructSize = sizeof(rtl_TextEncodingInfo);
::std::vector< rtl_TextEncoding > aEncs;
sal_Int32 nCount = svxform::charset_helper::getSupportedTextEncodings( aEncs );
for ( sal_Int32 j=0; j<nCount; j++ )
{
bool bInsert = true;
rtl_TextEncoding nEnc = rtl_TextEncoding( aEncs[j] );
if ( nExcludeInfoFlags )
{
if ( !rtl_getTextEncodingInfo( nEnc, &aInfo ) )
bInsert = false;
else
{
if ( (aInfo.Flags & nExcludeInfoFlags) == 0 )
{
if ( (nExcludeInfoFlags & RTL_TEXTENCODING_INFO_UNICODE) &&
((nEnc == RTL_TEXTENCODING_UCS2) ||
nEnc == RTL_TEXTENCODING_UCS4) )
bInsert = false; // InfoFlags don't work for Unicode :-(
}
else
bInsert = false;
}
}
if ( bInsert )
{
if ( bExcludeImportSubsets )
{
switch ( nEnc )
{
// subsets of RTL_TEXTENCODING_GB_18030
case RTL_TEXTENCODING_GB_2312 :
case RTL_TEXTENCODING_GBK :
case RTL_TEXTENCODING_MS_936 :
bInsert = false;
break;
}
}
// CharsetMap offers a RTL_TEXTENCODING_DONTKNOW for internal use,
// makes no sense here and would result in an empty string as list
// entry.
if ( bInsert && nEnc != RTL_TEXTENCODING_DONTKNOW )
InsertTextEncoding( nEnc );
}
}
#endif
}
void TextEncodingBox::FillWithMimeAndSelectBest()
{
FillFromTextEncodingTable( false, 0xffffffff, RTL_TEXTENCODING_INFO_MIME );
rtl_TextEncoding nEnc = SvtSysLocale::GetBestMimeEncoding();
SelectTextEncoding( nEnc );
}
void TextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc,
const OUString& rEntry )
{
m_xControl->append(OUString::number(nEnc), rEntry);
}
void TextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc )
{
const OUString& rEntry = SvxTextEncodingTable::GetTextString(nEnc);
if (!rEntry.isEmpty())
InsertTextEncoding( nEnc, rEntry );
else
SAL_WARN( "svx.dialog", "TextEncodingBox::InsertTextEncoding: no resource string for text encoding: " << static_cast<sal_Int32>( nEnc ) );
}
rtl_TextEncoding TextEncodingBox::GetSelectTextEncoding() const
{
OUString sId(m_xControl->get_active_id());
if (!sId.isEmpty())
return rtl_TextEncoding(sId.toInt32());
else
return RTL_TEXTENCODING_DONTKNOW;
}
void TextEncodingBox::SelectTextEncoding( const rtl_TextEncoding nEnc )
{
m_xControl->set_active_id(OUString::number(nEnc));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -384,8 +384,8 @@ public:
virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg() = 0;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(vcl::Window* pParent, const SfxItemSet& rSet) = 0;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg ( SwDocShell& rDocSh,
SvStream* pStream ) = 0;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq ) = 0;
virtual VclPtr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
......
......@@ -92,7 +92,10 @@ using namespace css::uno;
IMPL_ABSTDLG_BASE(AbstractSwWordCountFloatDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl);
IMPL_ABSTDLG_BASE(SwAbstractSfxDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSwAsciiFilterDlg_Impl);
short AbstractSwAsciiFilterDlg_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl);
short AbstractSplitTableDialog_Impl::Execute()
{
......@@ -227,7 +230,7 @@ void SwAbstractSfxDialog_Impl::SetText( const OUString& rStr )
void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions )
{
pDlg->FillOptions(rOptions);
m_xDlg->FillOptions(rOptions);
}
SplitTable_HeadlineOption AbstractSplitTableDialog_Impl::GetSplitMode()
......@@ -705,11 +708,10 @@ VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateNumFormatDialog( v
return VclPtr<SwAbstractSfxDialog_Impl>::Create( pDlg );
}
VclPtr<AbstractSwAsciiFilterDlg> SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( SwDocShell& rDocSh,
SvStream* pStream )
VclPtr<AbstractSwAsciiFilterDlg> SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg(weld::Window* pParent,
SwDocShell& rDocSh, SvStream* pStream)
{
VclPtr<SwAsciiFilterDlg> pDlg = VclPtr<SwAsciiFilterDlg>::Create( nullptr, rDocSh, pStream );
return VclPtr<AbstractSwAsciiFilterDlg_Impl>::Create( pDlg );
return VclPtr<AbstractSwAsciiFilterDlg_Impl>::Create(new SwAsciiFilterDlg(pParent, rDocSh, pStream));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( vcl::Window *pParent,
......
......@@ -96,9 +96,15 @@ class SwAbstractSfxDialog_Impl :public SfxAbstractDialog
class AbstractSwAsciiFilterDlg_Impl : public AbstractSwAsciiFilterDlg
{
DECL_ABSTDLG_BASE( AbstractSwAsciiFilterDlg_Impl,SwAsciiFilterDlg )
protected:
std::unique_ptr<SwAsciiFilterDlg> m_xDlg;
public:
explicit AbstractSwAsciiFilterDlg_Impl(SwAsciiFilterDlg* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
virtual void FillOptions( SwAsciiOptions& rOptions ) override;
};
class VclAbstractDialog_Impl : public VclAbstractDialog
......@@ -500,8 +506,8 @@ public:
SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override;
virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg() override;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(vcl::Window* pParent, const SfxItemSet& rSet) override;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg ( SwDocShell& rDocSh,
SvStream* pStream ) override;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) override;
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq ) override;
virtual VclPtr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) override;
virtual VclPtr<VclAbstractDialog> CreateSwChangeDBDlg(SwView& rVw) override;
......
......@@ -19,10 +19,12 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWXFILTEROPTIONS_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_SWXFILTEROPTIONS_HXX
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase.hxx>
......@@ -35,12 +37,14 @@ class SwXFilterOptions : public ::cppu::WeakImplHelper<
css::ui::dialogs::XExecutableDialog,
css::document::XImporter,
css::document::XExporter,
css::lang::XInitialization,
css::lang::XServiceInfo >
{
OUString sFilterOptions;
css::uno::Reference< css::io::XInputStream > xInputStream;
css::uno::Reference< css::lang::XComponent > xModel;
css::uno::Reference< css::awt::XWindow > xDialogParent;
public:
SwXFilterOptions();
......@@ -64,6 +68,9 @@ public:
virtual void SAL_CALL setSourceDocument( const css::uno::Reference<
css::lang::XComponent >& xDoc ) override;
// XInitialization
virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
......
......@@ -30,30 +30,30 @@ class SwAsciiOptions;
class SvStream;
class SwDocShell;
class SwAsciiFilterDlg : public SfxModalDialog
class SwAsciiFilterDlg : public weld::GenericDialogController
{
VclPtr<SvxTextEncodingBox> m_pCharSetLB;
VclPtr<FixedText> m_pFontFT;
VclPtr<ListBox> m_pFontLB;
VclPtr<FixedText> m_pLanguageFT;
VclPtr<SvxLanguageBox> m_pLanguageLB;
VclPtr<RadioButton> m_pCRLF_RB;
VclPtr<RadioButton> m_pCR_RB;
VclPtr<RadioButton> m_pLF_RB;
bool m_bSaveLineStatus;
DECL_LINK( CharSetSelHdl, ListBox&, void );
DECL_LINK( LineEndHdl, RadioButton&, void );
bool m_bSaveLineStatus;
OUString m_sExtraData;
std::unique_ptr<TextEncodingBox> m_xCharSetLB;
std::unique_ptr<weld::Label> m_xFontFT;
std::unique_ptr<weld::ComboBoxText> m_xFontLB;
std::unique_ptr<weld::Label> m_xLanguageFT;
std::unique_ptr<LanguageBox> m_xLanguageLB;
std::unique_ptr<weld::RadioButton> m_xCRLF_RB;
std::unique_ptr<weld::RadioButton> m_xCR_RB;
std::unique_ptr<weld::RadioButton> m_xLF_RB;
DECL_LINK(CharSetSelHdl, weld::ComboBoxText&, void);
DECL_LINK(LineEndHdl, weld::ToggleButton&, void);
void SetCRLF( LineEnd eEnd );
LineEnd GetCRLF() const;
public:
// CTOR: for import - pStream is the inputstream
// for export - pStream must be 0
SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream );
SwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh, SvStream* pStream);
virtual ~SwAsciiFilterDlg() override;
virtual void dispose() override;
void FillOptions( SwAsciiOptions& rOptions );
};
......
......@@ -24,6 +24,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/propertysequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/ucbstreamhelper.hxx>
......@@ -96,7 +97,7 @@ sal_Int16 SwXFilterOptions::execute()
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
ScopedVclPtr<AbstractSwAsciiFilterDlg> pAsciiDlg(pFact->CreateSwAsciiFilterDlg(*pDocShell,
ScopedVclPtr<AbstractSwAsciiFilterDlg> pAsciiDlg(pFact->CreateSwAsciiFilterDlg(Application::GetFrameWeld(xDialogParent), *pDocShell,
pInStream.get()));
OSL_ENSURE(pAsciiDlg, "Dialog creation failed!");
if(RET_OK == pAsciiDlg->Execute())
......@@ -121,6 +122,13 @@ void SwXFilterOptions::setSourceDocument( const uno::Reference<XComponent >& x
xModel = xDoc;
}
void SAL_CALL SwXFilterOptions::initialize(const uno::Sequence<uno::Any>& rArguments)
{
::comphelper::NamedValueCollection aProperties(rArguments);
if (aProperties.has("ParentWindow"))
aProperties.get("ParentWindow") >>= xDialogParent;
}
OUString SwXFilterOptions::getImplementationName()
{
return OUString("com.sun.star.comp.Writer.FilterOptionsDialog");
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="sw">
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="AsciiFilterDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="asciifilterdialog|AsciiFilterDialog">ASCII Filter Options</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-vbox1">
......@@ -58,6 +61,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
......@@ -93,67 +97,59 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="asciifilterdialog|label2">_Character set</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">charset</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fontft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="asciifilterdialog|fontft">Default fonts</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">font</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="languageft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="asciifilterdialog|languageft">Lan_guage</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">language</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="asciifilterdialog|label5">_Paragraph break</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svxlo-SvxTextEncodingBox" id="charset">
<object class="GtkComboBoxText" id="charset">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
......@@ -161,8 +157,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -170,27 +164,10 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="svxcorelo-SvxLanguageBox" id="language">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -209,7 +186,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">cr</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -227,7 +203,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">lf</property>
<property name="group">crlf</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -257,8 +233,24 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="language">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry">
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
......@@ -289,5 +281,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -30,6 +30,7 @@
#include <com/sun/star/task/XInteractionRequest.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <comphelper/propertysequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <vcl/svapp.hxx>
......@@ -178,6 +179,7 @@ handleNoSuchFilterRequest_(
void
handleFilterOptionsRequest_(
uno::Reference<awt::XWindow> const & rWindow,
uno::Reference< uno::XComponentContext > const & xContext,
document::FilterOptionsRequest const & rRequest,
uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
......@@ -226,11 +228,17 @@ handleFilterOptionsRequest_(
aProps[nProperty].Value >>= aServiceName;
if( !aServiceName.isEmpty() )
{
uno::Sequence<uno::Any> aDialogArgs(comphelper::InitAnyPropertySequence(
{
{"ParentWindow", uno::Any(rWindow)},
}));
uno::Reference<
ui::dialogs::XExecutableDialog > xFilterDialog(
xContext->getServiceManager()->createInstanceWithContext(
aServiceName, xContext ),
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
aServiceName, aDialogArgs, xContext ),
uno::UNO_QUERY );
uno::Reference< beans::XPropertyAccess >
xFilterProperties( xFilterDialog,
uno::UNO_QUERY );
......@@ -302,7 +310,8 @@ UUIInteractionHelper::handleFilterOptionsRequest(
document::FilterOptionsRequest aFilterOptionsRequest;
if (aAnyRequest >>= aFilterOptionsRequest)
{
handleFilterOptionsRequest_(m_xContext,
handleFilterOptionsRequest_(getParentXWindow(),
m_xContext,
aFilterOptionsRequest,
rRequest->getContinuations());
return true;
......
......@@ -4281,7 +4281,7 @@ weld::Window* GtkInstance::GetFrameWeld(const css::uno::Reference<css::awt::XWin
{
if (SalGtkXWindow* pGtkXWindow = dynamic_cast<SalGtkXWindow*>(rWindow.get()))
return pGtkXWindow->getFrameWeld();
return nullptr;
return SalInstance::GetFrameWeld(rWindow);
}
weld::Window* GtkSalFrame::GetFrameWeld() const
......
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