Kaydet (Commit) 3b796947 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwFrmDlg ctor: turn sRestype into an OUString

In practice, currently possible values are ASCII, but then this string
becomes part of URLs, which are in general no longer ASCII, and are
OUStrings. Instead of trying to guess the encoding of the string we get,
require callers to create an OUString right away.

A follow-up commit could adapt SfxTabDialog ctor,
SwFrmPage::SetFrmType() and SwFrmAddPage::SetFrmType() accordingly to
avoid the new introduced OUStringToOString() calls.

Change-Id: I087ed2bb341f5aca59e15e2ef4102556ca803363
üst 03977c45
......@@ -389,7 +389,7 @@ public:
virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) = 0;
virtual VclAbstractDialog* CreateTblMergeDialog( vcl::Window* pParent, bool& rWithPrev ) = 0;
virtual SfxAbstractTabDialog* CreateFrmTabDialog(const OString &rDialogType,
virtual SfxAbstractTabDialog* CreateFrmTabDialog(const OUString &rDialogType,
SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
bool bNewFrm = true,
......
......@@ -938,7 +938,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTblMergeDialog(vcl::Wind
return new VclAbstractDialog_Impl( pDlg );
}
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog(const OString &rDialogType,
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog(const OUString &rDialogType,
SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
bool bNewFrm,
......
......@@ -435,7 +435,7 @@ public:
virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) SAL_OVERRIDE;
virtual VclAbstractDialog* CreateTblMergeDialog(vcl::Window* pParent, bool& rWithPrev) SAL_OVERRIDE;
virtual SfxAbstractTabDialog* CreateFrmTabDialog( const OString &rDialogType,
virtual SfxAbstractTabDialog* CreateFrmTabDialog( const OUString &rDialogType,
SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
bool bNewFrm = true,
......
......@@ -48,14 +48,14 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
vcl::Window* pParent,
const SfxItemSet& rCoreSet,
bool bNewFrm,
const OString& sResType,
const OUString& sResType,
bool bFormat,
const OString& sDefPage,
const OUString* pStr)
: SfxTabDialog(pViewFrame, pParent, sResType,
: SfxTabDialog(pViewFrame, pParent, OUStringToOString(sResType, RTL_TEXTENCODING_UTF8),
OUString("modules/swriter/ui/") +
OUString::fromUtf8(sResType.toAsciiLowerCase()) +
sResType.toAsciiLowerCase() +
(".ui"), &rCoreSet, pStr != 0)
, m_bFormat(bFormat)
, m_bNew(bNewFrm)
......@@ -148,12 +148,12 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
((SwFrmPage&)rPage).SetNewFrame(m_bNew);
((SwFrmPage&)rPage).SetFormatUsed(m_bFormat);
((SwFrmPage&)rPage).SetFrmType(m_sDlgType);
((SwFrmPage&)rPage).SetFrmType(OUStringToOString(m_sDlgType, RTL_TEXTENCODING_UTF8));
}
else if (nId == m_nAddId)
{
((SwFrmAddPage&)rPage).SetFormatUsed(m_bFormat);
((SwFrmAddPage&)rPage).SetFrmType(m_sDlgType);
((SwFrmAddPage&)rPage).SetFrmType(OUStringToOString(m_sDlgType, RTL_TEXTENCODING_UTF8));
((SwFrmAddPage&)rPage).SetNewFrame(m_bNew);
((SwFrmAddPage&)rPage).SetShell(m_pWrtShell);
}
......
......@@ -31,7 +31,7 @@ class SwFrmDlg : public SfxTabDialog
bool m_bNew;
bool m_bHTMLMode;
const SfxItemSet& m_rSet;
OString m_sDlgType;
OUString m_sDlgType;
SwWrtShell* m_pWrtShell;
sal_uInt16 m_nStdId;
......@@ -53,7 +53,7 @@ public:
SwFrmDlg( SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
bool bNewFrm = false,
const OString& sResType = OString("FrameDialog"),
const OUString& sResType = OUString("FrameDialog"),
bool bFmt = false,
const OString& sDefPage = OString(),
const OUString* pFmtStr = 0);
......
......@@ -501,9 +501,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateFrmTabDialog(
nSel & nsSelectionType::SEL_GRF ? "PictureDialog" :
nSel & nsSelectionType::SEL_OLE ? "ObjectDialog":
"FrameDialog",
nSel & nsSelectionType::SEL_GRF ? OUString("PictureDialog") :
nSel & nsSelectionType::SEL_OLE ? OUString("ObjectDialog"):
OUString("FrameDialog"),
GetView().GetViewFrame(),
GetView().GetWindow(),
aSet, false,
......
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