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
4bddfc00
Kaydet (Commit)
4bddfc00
authored
Kas 18, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
lok::Document::initializeForRendering: support init. arguments
Change-Id: I8aaf19a50f25f495cb87fba7ff6a4b0f56ed7d80
üst
0a779d1d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
43 deletions
+60
-43
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+2
-2
init.cxx
desktop/source/lib/init.cxx
+40
-36
lokandroid.cxx
desktop/source/lib/lokandroid.cxx
+1
-1
LibreOfficeKit.h
include/LibreOfficeKit/LibreOfficeKit.h
+2
-1
LibreOfficeKit.hxx
include/LibreOfficeKit/LibreOfficeKit.hxx
+14
-2
lokdocview.cxx
libreofficekit/source/gtk/lokdocview.cxx
+1
-1
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
4bddfc00
...
...
@@ -283,7 +283,7 @@ void DesktopLOKTest::testSearchCalc()
LibLibreOffice_Impl
aOffice
;
comphelper
::
LibreOfficeKit
::
setActive
();
LibLODocument_Impl
*
pDocument
=
loadDoc
(
"search.ods"
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
,
nullptr
);
pDocument
->
pClass
->
registerCallback
(
pDocument
,
&
DesktopLOKTest
::
callback
,
this
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aPropertyValues
(
comphelper
::
InitPropertySequence
(
...
...
@@ -406,7 +406,7 @@ void DesktopLOKTest::testRowColumnHeaders()
*/
LibLODocument_Impl
*
pDocument
=
loadDoc
(
"search.ods"
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
,
nullptr
);
boost
::
property_tree
::
ptree
aTree
;
char
*
pJSON
=
pDocument
->
m_pDocumentClass
->
getCommandValues
(
pDocument
,
".uno:ViewRowColumnHeaders"
);
...
...
desktop/source/lib/init.cxx
Dosyayı görüntüle @
4bddfc00
...
...
@@ -261,6 +261,40 @@ static OUString getAbsoluteURL(const char* pURL)
return
OUString
();
}
static
void
jsonToPropertyValues
(
const
char
*
pJSON
,
uno
::
Sequence
<
beans
::
PropertyValue
>&
rPropertyValues
)
{
std
::
vector
<
beans
::
PropertyValue
>
aArguments
;
if
(
pJSON
)
{
boost
::
property_tree
::
ptree
aTree
;
std
::
stringstream
aStream
(
pJSON
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aTree
)
{
const
std
::
string
&
rType
=
rPair
.
second
.
get
<
std
::
string
>
(
"type"
);
const
std
::
string
&
rValue
=
rPair
.
second
.
get
<
std
::
string
>
(
"value"
);
beans
::
PropertyValue
aValue
;
aValue
.
Name
=
OUString
::
fromUtf8
(
rPair
.
first
.
c_str
());
if
(
rType
==
"string"
)
aValue
.
Value
<<=
OUString
::
fromUtf8
(
rValue
.
c_str
());
else
if
(
rType
==
"boolean"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toBoolean
();
else
if
(
rType
==
"float"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toFloat
();
else
if
(
rType
==
"long"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toInt32
();
else
if
(
rType
==
"unsigned short"
)
aValue
.
Value
<<=
static_cast
<
sal_uInt16
>
(
OString
(
rValue
.
c_str
()).
toUInt32
());
else
SAL_WARN
(
"desktop.lib"
,
"jsonToPropertyValues: unhandled type '"
<<
rType
<<
"'"
);
aArguments
.
push_back
(
aValue
);
}
}
rPropertyValues
=
comphelper
::
containerToSequence
(
aArguments
);
}
extern
"C"
{
...
...
@@ -281,7 +315,8 @@ void doc_paintTile(LibreOfficeKitDocument* pThis,
static
void
doc_getDocumentSize
(
LibreOfficeKitDocument
*
pThis
,
long
*
pWidth
,
long
*
pHeight
);
static
void
doc_initializeForRendering
(
LibreOfficeKitDocument
*
pThis
);
static
void
doc_initializeForRendering
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pArguments
);
static
void
doc_registerCallback
(
LibreOfficeKitDocument
*
pThis
,
LibreOfficeKitCallback
pCallback
,
...
...
@@ -939,12 +974,15 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
}
}
static
void
doc_initializeForRendering
(
LibreOfficeKitDocument
*
pThis
)
static
void
doc_initializeForRendering
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pArguments
)
{
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
if
(
pDoc
)
{
doc_iniUnoCommands
();
uno
::
Sequence
<
beans
::
PropertyValue
>
aPropertyValues
;
jsonToPropertyValues
(
pArguments
,
aPropertyValues
);
pDoc
->
initializeForTiledRendering
();
}
}
...
...
@@ -988,40 +1026,6 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
pDoc
->
postKeyEvent
(
nType
,
nCharCode
,
nKeyCode
);
}
static
void
jsonToPropertyValues
(
const
char
*
pJSON
,
uno
::
Sequence
<
beans
::
PropertyValue
>&
rPropertyValues
)
{
std
::
vector
<
beans
::
PropertyValue
>
aArguments
;
if
(
pJSON
)
{
boost
::
property_tree
::
ptree
aTree
;
std
::
stringstream
aStream
(
pJSON
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aTree
)
{
const
std
::
string
&
rType
=
rPair
.
second
.
get
<
std
::
string
>
(
"type"
);
const
std
::
string
&
rValue
=
rPair
.
second
.
get
<
std
::
string
>
(
"value"
);
beans
::
PropertyValue
aValue
;
aValue
.
Name
=
OUString
::
fromUtf8
(
rPair
.
first
.
c_str
());
if
(
rType
==
"string"
)
aValue
.
Value
<<=
OUString
::
fromUtf8
(
rValue
.
c_str
());
else
if
(
rType
==
"boolean"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toBoolean
();
else
if
(
rType
==
"float"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toFloat
();
else
if
(
rType
==
"long"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toInt32
();
else
if
(
rType
==
"unsigned short"
)
aValue
.
Value
<<=
static_cast
<
sal_uInt16
>
(
OString
(
rValue
.
c_str
()).
toUInt32
());
else
SAL_WARN
(
"desktop.lib"
,
"jsonToPropertyValues: unhandled type '"
<<
rType
<<
"'"
);
aArguments
.
push_back
(
aValue
);
}
}
rPropertyValues
=
comphelper
::
containerToSequence
(
aArguments
);
}
/** Class to react on finishing of a dispatched command.
This will call a LOK_COMMAND_FINISHED callback when postUnoCommand was
...
...
desktop/source/lib/lokandroid.cxx
Dosyayı görüntüle @
4bddfc00
...
...
@@ -256,7 +256,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_initial
(
JNIEnv
*
pEnv
,
jobject
aObject
)
{
LibreOfficeKitDocument
*
pDocument
=
getHandle
<
LibreOfficeKitDocument
>
(
pEnv
,
aObject
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
);
pDocument
->
pClass
->
initializeForRendering
(
pDocument
,
NULL
);
}
extern
"C"
SAL_JNI_EXPORT
jint
JNICALL
Java_org_libreoffice_kit_Office_saveAs
...
...
include/LibreOfficeKit/LibreOfficeKit.h
Dosyayı görüntüle @
4bddfc00
...
...
@@ -124,7 +124,8 @@ struct _LibreOfficeKitDocumentClass
long
*
pHeight
);
/// @see lok::Document::initializeForRendering().
void
(
*
initializeForRendering
)
(
LibreOfficeKitDocument
*
pThis
);
void
(
*
initializeForRendering
)
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pArguments
);
/// @see lok::Document::registerCallback().
void
(
*
registerCallback
)
(
LibreOfficeKitDocument
*
pThis
,
...
...
include/LibreOfficeKit/LibreOfficeKit.hxx
Dosyayı görüntüle @
4bddfc00
...
...
@@ -156,10 +156,22 @@ public:
* needed to render the document correctly using tiled rendering. This
* method has to be called right after documentLoad() in case any of the
* tiled rendering methods are to be used later.
*
* Example argument string for text documents:
*
* {
* ".uno:HideWhitespace":
* {
* "type": "boolean",
* "value": "true"
* }
* }
*
* @param pArguments arguments of the rendering
*/
inline
void
initializeForRendering
()
inline
void
initializeForRendering
(
const
char
*
pArguments
=
NULL
)
{
mpDoc
->
pClass
->
initializeForRendering
(
mpDoc
);
mpDoc
->
pClass
->
initializeForRendering
(
mpDoc
,
pArguments
);
}
/**
...
...
libreofficekit/source/gtk/lokdocview.cxx
Dosyayı görüntüle @
4bddfc00
...
...
@@ -530,7 +530,7 @@ static gboolean postDocumentLoad(gpointer pData)
LOKDocViewPrivate
&
priv
=
getPrivate
(
pLOKDocView
);
priv
->
m_pDocument
->
pClass
->
setView
(
priv
->
m_pDocument
,
priv
->
m_nViewId
);
priv
->
m_pDocument
->
pClass
->
initializeForRendering
(
priv
->
m_pDocument
);
priv
->
m_pDocument
->
pClass
->
initializeForRendering
(
priv
->
m_pDocument
,
nullptr
);
priv
->
m_pDocument
->
pClass
->
registerCallback
(
priv
->
m_pDocument
,
callbackWorker
,
pLOKDocView
);
priv
->
m_pDocument
->
pClass
->
getDocumentSize
(
priv
->
m_pDocument
,
&
priv
->
m_nDocumentWidthTwips
,
&
priv
->
m_nDocumentHeightTwips
);
g_timeout_add
(
600
,
handleTimeout
,
pLOKDocView
);
...
...
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