Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ea2738ec
Kaydet (Commit)
ea2738ec
authored
Eki 23, 2013
tarafından
Ptyl Dragon
Kaydeden (comit)
Jan Holesovsky
Eki 23, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tiledrendering opens files
Change-Id: Ifbf5a3aad016e1c90c4c331b2f72b44203717f90
üst
4db91c7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
47 deletions
+62
-47
tiledrendering.cxx
sw/qa/tiledrendering/tiledrendering.cxx
+62
-47
No files found.
sw/qa/tiledrendering/tiledrendering.cxx
Dosyayı görüntüle @
ea2738ec
...
@@ -24,23 +24,40 @@
...
@@ -24,23 +24,40 @@
#include <sfx2/filedlghelper.hxx>
#include <sfx2/filedlghelper.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <sfx2/filedlghelper.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
ui
::
dialogs
;
using
namespace
::
sfx2
;
class
UIPreview
App
:
public
Application
class
TiledRendering
App
:
public
Application
{
{
private
:
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
;
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
xFactory
;
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xSFactory
;
uno
::
Reference
<
uno
::
XInterface
>
xDesktop
;
uno
::
Reference
<
frame
::
XComponentLoader
>
xLoader
;
uno
::
Reference
<
lang
::
XComponent
>
xComponent
;
public
:
public
:
virtual
void
Init
();
virtual
void
Init
();
virtual
int
Main
();
virtual
int
Main
();
void
Open
(
OUString
&
aFileUrl
);
};
};
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
ui
::
dialogs
;
using
namespace
::
sfx2
;
class
TiledRenderingDialog
:
public
ModalDialog
{
class
TiledRenderingDialog
:
public
ModalDialog
{
private
:
TiledRenderingApp
*
app
;
public
:
public
:
TiledRenderingDialog
()
:
ModalDialog
(
DIALOG_NO_PARENT
,
"TiledRendering"
,
"qa/sw/ui/tiledrendering.ui"
)
TiledRenderingDialog
(
TiledRenderingApp
*
app
)
:
ModalDialog
(
DIALOG_NO_PARENT
,
"TiledRendering"
,
"qa/sw/ui/tiledrendering.ui"
),
app
(
app
)
{
{
PushButton
*
renderButton
;
PushButton
*
renderButton
;
get
(
renderButton
,
"buttonRenderTile"
);
get
(
renderButton
,
"buttonRenderTile"
);
...
@@ -52,6 +69,7 @@ public:
...
@@ -52,6 +69,7 @@ public:
SetStyle
(
GetStyle
()
|
WB_CLOSEABLE
);
SetStyle
(
GetStyle
()
|
WB_CLOSEABLE
);
}
}
virtual
~
TiledRenderingDialog
()
virtual
~
TiledRenderingDialog
()
{
{
}
}
...
@@ -59,12 +77,11 @@ public:
...
@@ -59,12 +77,11 @@ public:
DECL_LINK
(
RenderHdl
,
Button
*
);
DECL_LINK
(
RenderHdl
,
Button
*
);
DECL_LINK
(
ChooseDocumentHdl
,
Button
*
);
DECL_LINK
(
ChooseDocumentHdl
,
Button
*
);
sal_Int32
e
xtractInt
(
const
char
*
name
)
sal_Int32
E
xtractInt
(
const
char
*
name
)
{
{
NumericField
*
pField
;
NumericField
*
pField
;
get
(
pField
,
name
);
get
(
pField
,
name
);
OUString
aString
(
pField
->
GetText
());
OUString
aString
(
pField
->
GetText
());
std
::
cerr
<<
"param "
<<
name
<<
" returned "
<<
aString
<<
"
\n
"
;
return
aString
.
toInt32
();
return
aString
.
toInt32
();
}
}
...
@@ -72,12 +89,12 @@ public:
...
@@ -72,12 +89,12 @@ public:
IMPL_LINK
(
TiledRenderingDialog
,
RenderHdl
,
Button
*
,
EMPTYARG
)
IMPL_LINK
(
TiledRenderingDialog
,
RenderHdl
,
Button
*
,
EMPTYARG
)
{
{
e
xtractInt
(
"spinContextWidth"
);
E
xtractInt
(
"spinContextWidth"
);
e
xtractInt
(
"spinContextHeight"
);
E
xtractInt
(
"spinContextHeight"
);
e
xtractInt
(
"spinTilePosX"
);
E
xtractInt
(
"spinTilePosX"
);
e
xtractInt
(
"spinTilePosY"
);
E
xtractInt
(
"spinTilePosY"
);
e
xtractInt
(
"spinTileWidth"
);
E
xtractInt
(
"spinTileWidth"
);
e
xtractInt
(
"spinTileHeight"
);
E
xtractInt
(
"spinTileHeight"
);
return
1
;
return
1
;
}
}
...
@@ -87,64 +104,62 @@ IMPL_LINK ( TiledRenderingDialog, ChooseDocumentHdl, Button *, EMPTYARG )
...
@@ -87,64 +104,62 @@ IMPL_LINK ( TiledRenderingDialog, ChooseDocumentHdl, Button *, EMPTYARG )
uno
::
Reference
<
XFilePicker
>
xFP
=
aDlgHelper
.
GetFilePicker
();
uno
::
Reference
<
XFilePicker
>
xFP
=
aDlgHelper
.
GetFilePicker
();
if
(
aDlgHelper
.
Execute
()
==
ERRCODE_NONE
)
if
(
aDlgHelper
.
Execute
()
==
ERRCODE_NONE
)
{
{
OUString
aFile
Path
=
xFP
->
getFiles
().
getConstArray
()[
0
];
OUString
aFile
Url
=
xFP
->
getFiles
().
getConstArray
()[
0
];
std
::
cerr
<<
aFilePath
<<
"
\n
"
;
app
->
Open
(
aFileUrl
)
;
}
}
return
1
;
return
1
;
}
}
void
UIPreviewApp
::
Init
()
void
TiledRenderingApp
::
Open
(
OUString
&
aFileUrl
){
static
const
OUString
TARGET
(
"_default"
);
static
const
Sequence
<
beans
::
PropertyValue
>
PROPS
(
0
);
if
(
xComponent
.
get
())
{
xComponent
->
dispose
();
xComponent
.
clear
();
}
xComponent
.
set
(
xLoader
->
loadComponentFromURL
(
aFileUrl
,
TARGET
,
0
,
PROPS
));
}
void
TiledRenderingApp
::
Init
()
{
{
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
=
xContext
.
set
(
cppu
::
defaultBootstrap_InitialComponentContext
());
cppu
::
defaultBootstrap_InitialComponentContext
();
xFactory
.
set
(
xContext
->
getServiceManager
());
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
xFactory
=
xSFactory
.
set
(
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xFactory
,
uno
::
UNO_QUERY_THROW
));
xContext
->
getServiceManager
();
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xSFactory
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xFactory
,
uno
::
UNO_QUERY_THROW
);
comphelper
::
setProcessServiceFactory
(
xSFactory
);
comphelper
::
setProcessServiceFactory
(
xSFactory
);
// Create UCB (for backwards compatibility, in case some code still uses
// Create UCB (for backwards compatibility, in case some code still uses
// plain createInstance w/o args directly to obtain an instance):
// plain createInstance w/o args directly to obtain an instance):
::
ucb
::
UniversalContentBroker
::
create
(
::
ucb
::
UniversalContentBroker
::
create
(
comphelper
::
getProcessComponentContext
()
);
comphelper
::
getProcessComponentContext
()
);
xDesktop
.
set
(
xFactory
->
createInstanceWithContext
(
OUString
(
"com.sun.star.frame.Desktop"
),
xContext
));
xLoader
.
set
(
frame
::
Desktop
::
create
(
xContext
));
}
}
int
UIPreview
App
::
Main
()
int
TiledRendering
App
::
Main
()
{
{
//std::vector<OUString> uifiles;
if
(
GetCommandLineParamCount
()
>
0
)
//for (sal_uInt16 i = 0; i < GetCommandLineParamCount(); ++i)
{
//{
OUString
aFileUrl
;
// OUString aFileUrl;
osl
::
File
::
getFileURLFromSystemPath
(
GetCommandLineParam
(
0
),
aFileUrl
);
// osl::File::getFileURLFromSystemPath(GetCommandLineParam(i), aFileUrl);
Open
(
aFileUrl
);
// uifiles.push_back(aFileUrl);
}
//}
//if (uifiles.empty())
//{
// fprintf(stderr, "Usage: ui-previewer file.ui\n");
// return EXIT_FAILURE;
//}
// turn on tooltips
Help
::
EnableQuickHelp
();
Help
::
EnableQuickHelp
();
try
try
{
{
TiledRenderingDialog
pDialog
(
this
);
TiledRenderingDialog
pDialog
;
pDialog
.
Execute
();
pDialog
.
Execute
();
}
}
catch
(
const
uno
::
Exception
&
e
)
catch
(
const
uno
::
Exception
&
e
)
{
{
fprintf
(
stderr
,
"fatal error: %s
\n
"
,
OUStringToOString
(
e
.
Message
,
osl_getThreadTextEncoding
()).
getStr
());
fprintf
(
stderr
,
"fatal error: %s
\n
"
,
OUStringToOString
(
e
.
Message
,
osl_getThreadTextEncoding
()).
getStr
());
}
}
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
void
vclmain
::
createApplication
()
void
vclmain
::
createApplication
()
{
{
static
UIPreview
App
aApp
;
static
TiledRendering
App
aApp
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment