22#include <com/sun/star/awt/PushButtonType.hpp>
23#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
24#include <com/sun/star/util/URL.hpp>
25#include <com/sun/star/util/URLTransformer.hpp>
26#include <com/sun/star/util/XURLTransformer.hpp>
27#include <rtl/ustrbuf.hxx>
42 double fVal(
static_cast<double>( rVal ) );
45 OUStringBuffer aVal( OUString::number( fVal ) );
46 sal_Int32 nX( aVal.indexOf(
'.' ) );
48 aVal.setLength( nX + 2 );
49 return aVal.makeStringAndClear();
81 Reference< XURLTransformer > xURLTransformer( URLTransformer::create(
mxContext) );
82 util::URL
aURL, aPresentationURL;
84 xURLTransformer->parseSmart(
aURL, OUString() );
86 static constexpr OUStringLiteral sFileProtocol(
u"file:///" );
87 aPresentationURL.Complete = sFileProtocol +
aURL.Name;
88 aTitle = xURLTransformer->getPresentation( aPresentationURL,
false );
90 if ( aTitle.match( sFileProtocol ) )
91 aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(),
u"" );
95 OUString sSecondary(
getString( eInfoString ) );
96 static constexpr OUStringLiteral aOldSizePlaceholder(
u"%OLDFILESIZE" );
97 static constexpr OUStringLiteral aNewSizePlaceholder(
u"%NEWFILESIZE" );
98 const OUString aTitlePlaceholder( !aTitle.isEmpty() ? OUString(
"%TITLE" )
99 : OUString(
"'%TITLE'") );
101 sal_Int32
i = sSecondary.indexOf( aOldSizePlaceholder );
103 sSecondary = sSecondary.replaceAt(
i, aOldSizePlaceholder.getLength(),
ImpValueOfInMB( nSource ) );
105 sal_Int32 j = sSecondary.indexOf( aNewSizePlaceholder );
107 sSecondary = sSecondary.replaceAt( j, aNewSizePlaceholder.getLength(),
ImpValueOfInMB( nDest ) );
109 sal_Int32 k = sPrimary.indexOf( aTitlePlaceholder );
111 sPrimary = sPrimary.replaceAt( k, aTitlePlaceholder.getLength(), aTitle );
120 const OUString& rSaveAsURL,
bool& rbOpenNewDocument,
121 sal_Int64 rSourceSize, sal_Int64 rDestSize, sal_Int64 rApproxSize)
122 : MessageDialogController(
Application::
GetFrameWeld(rxDialogParent),
"modules/simpress/ui/pminfodialog.ui",
"PMInfoDialog",
"ask")
124 , mxCheckBox(m_xBuilder->weld_check_button(
"ask"))
125 , mnSourceSize(rSourceSize)
126 , mnDestSize(rDestSize)
127 , mnApproxSize(rApproxSize)
128 , mrbOpenNewDocument(rbOpenNewDocument)
129 , maSaveAsURL(rSaveAsURL)
OUString getString(const PPPOptimizerTokenEnum) const
css::uno::Reference< css::uno::XComponentContext > mxContext
void set_title(const OUString &rTitle)
void set_primary_text(const OUString &rText)
void set_secondary_text(const OUString &rText)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
@ STR_SUN_OPTIMIZATION_WIZARD2