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
262e7be0
Kaydet (Commit)
262e7be0
authored
Eyl 04, 2015
tarafından
Mihai Varga
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert "LOK: added a general getCommandValues method"
This reverts commit
9640dcea
.
üst
b70b4ae2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
33 deletions
+10
-33
init.cxx
desktop/source/lib/init.cxx
+4
-20
LibreOfficeKit.h
include/LibreOfficeKit/LibreOfficeKit.h
+1
-1
LibreOfficeKit.hxx
include/LibreOfficeKit/LibreOfficeKit.hxx
+3
-6
tiledrendering.cxx
libreofficekit/qa/unit/tiledrendering.cxx
+2
-6
No files found.
desktop/source/lib/init.cxx
Dosyayı görüntüle @
262e7be0
...
@@ -235,7 +235,7 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis,
...
@@ -235,7 +235,7 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis,
int
nX
,
int
nX
,
int
nY
);
int
nY
);
static
void
doc_resetSelection
(
LibreOfficeKitDocument
*
pThis
);
static
void
doc_resetSelection
(
LibreOfficeKitDocument
*
pThis
);
static
char
*
doc_get
CommandValues
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pCommand
);
static
char
*
doc_get
Styles
(
LibreOfficeKitDocument
*
pThis
);
struct
LibLODocument_Impl
:
public
_LibreOfficeKitDocument
struct
LibLODocument_Impl
:
public
_LibreOfficeKitDocument
{
{
...
@@ -270,7 +270,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
...
@@ -270,7 +270,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass
->
getTextSelection
=
doc_getTextSelection
;
m_pDocumentClass
->
getTextSelection
=
doc_getTextSelection
;
m_pDocumentClass
->
setGraphicSelection
=
doc_setGraphicSelection
;
m_pDocumentClass
->
setGraphicSelection
=
doc_setGraphicSelection
;
m_pDocumentClass
->
resetSelection
=
doc_resetSelection
;
m_pDocumentClass
->
resetSelection
=
doc_resetSelection
;
m_pDocumentClass
->
get
CommandValues
=
doc_getCommandValu
es
;
m_pDocumentClass
->
get
Styles
=
doc_getStyl
es
;
gDocumentClass
=
m_pDocumentClass
;
gDocumentClass
=
m_pDocumentClass
;
}
}
...
@@ -870,17 +870,15 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis)
...
@@ -870,17 +870,15 @@ static void doc_resetSelection(LibreOfficeKitDocument* pThis)
pDoc
->
resetSelection
();
pDoc
->
resetSelection
();
}
}
static
char
*
getStyles
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pCommand
)
static
char
*
doc_getStyles
(
LibreOfficeKitDocument
*
pThis
)
{
{
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
LibLODocument_Impl
*
pDocument
=
static_cast
<
LibLODocument_Impl
*>
(
pThis
);
boost
::
property_tree
::
ptree
aTree
;
boost
::
property_tree
::
ptree
aTree
;
aTree
.
put
(
"commandName"
,
pCommand
);
uno
::
Reference
<
css
::
style
::
XStyleFamiliesSupplier
>
xStyleFamiliesSupplier
(
pDocument
->
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
css
::
style
::
XStyleFamiliesSupplier
>
xStyleFamiliesSupplier
(
pDocument
->
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XNameAccess
>
xStyleFamilies
(
xStyleFamiliesSupplier
->
getStyleFamilies
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XNameAccess
>
xStyleFamilies
(
xStyleFamiliesSupplier
->
getStyleFamilies
(),
uno
::
UNO_QUERY
);
uno
::
Sequence
<
OUString
>
aStyleFamilies
=
xStyleFamilies
->
getElementNames
();
uno
::
Sequence
<
OUString
>
aStyleFamilies
=
xStyleFamilies
->
getElementNames
();
boost
::
property_tree
::
ptree
aValues
;
for
(
sal_Int32
nStyleFam
=
0
;
nStyleFam
<
aStyleFamilies
.
getLength
();
++
nStyleFam
)
for
(
sal_Int32
nStyleFam
=
0
;
nStyleFam
<
aStyleFamilies
.
getLength
();
++
nStyleFam
)
{
{
boost
::
property_tree
::
ptree
aChildren
;
boost
::
property_tree
::
ptree
aChildren
;
...
@@ -893,9 +891,8 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
...
@@ -893,9 +891,8 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
aChild
.
put
(
""
,
aStyles
[
nInd
]);
aChild
.
put
(
""
,
aStyles
[
nInd
]);
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
}
}
a
Values
.
add_child
(
sStyleFam
.
toUtf8
().
getStr
(),
aChildren
);
a
Tree
.
add_child
(
sStyleFam
.
toUtf8
().
getStr
(),
aChildren
);
}
}
aTree
.
add_child
(
"commandValues"
,
aValues
);
std
::
stringstream
aStream
;
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
char
*
pJson
=
static_cast
<
char
*>
(
malloc
(
aStream
.
str
().
size
()
+
1
));
char
*
pJson
=
static_cast
<
char
*>
(
malloc
(
aStream
.
str
().
size
()
+
1
));
...
@@ -903,19 +900,6 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
...
@@ -903,19 +900,6 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
pJson
[
aStream
.
str
().
size
()]
=
'\0'
;
pJson
[
aStream
.
str
().
size
()]
=
'\0'
;
return
pJson
;
return
pJson
;
}
}
static
char
*
doc_getCommandValues
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pCommand
)
{
if
(
!
strcmp
(
pCommand
,
".uno:StyleApply"
))
{
return
getStyles
(
pThis
,
pCommand
);
}
else
{
gImpl
->
maLastExceptionMsg
=
"Unknown command, no values returned"
;
return
NULL
;
}
}
static
char
*
lo_getError
(
LibreOfficeKit
*
pThis
)
static
char
*
lo_getError
(
LibreOfficeKit
*
pThis
)
{
{
LibLibreOffice_Impl
*
pLib
=
static_cast
<
LibLibreOffice_Impl
*>
(
pThis
);
LibLibreOffice_Impl
*
pLib
=
static_cast
<
LibLibreOffice_Impl
*>
(
pThis
);
...
...
include/LibreOfficeKit/LibreOfficeKit.h
Dosyayı görüntüle @
262e7be0
...
@@ -161,7 +161,7 @@ struct _LibreOfficeKitDocumentClass
...
@@ -161,7 +161,7 @@ struct _LibreOfficeKitDocumentClass
void
(
*
resetSelection
)
(
LibreOfficeKitDocument
*
pThis
);
void
(
*
resetSelection
)
(
LibreOfficeKitDocument
*
pThis
);
/// @see lok::Document:getStyles
/// @see lok::Document:getStyles
char
*
(
*
get
CommandValues
)
(
LibreOfficeKitDocument
*
pThis
,
const
char
*
pCommand
);
char
*
(
*
get
Styles
)
(
LibreOfficeKitDocument
*
pThis
);
#endif // LOK_USE_UNSTABLE_API
#endif // LOK_USE_UNSTABLE_API
};
};
...
...
include/LibreOfficeKit/LibreOfficeKit.hxx
Dosyayı görüntüle @
262e7be0
...
@@ -248,14 +248,11 @@ public:
...
@@ -248,14 +248,11 @@ public:
}
}
/**
/**
* Returns a json mapping of the possible values for the given command
* Returns a json map, {"familyName1" : ["list of style names in the family1"], etc.}
* e.g. {commandName: ".uno:StyleApply", commandValues: {"familyName1" : ["list of style names in the family1"], etc.}}
* @param pCommand a uno command for which the possible values are requested
* @return {commandName: unoCmd, commandValues: {possible_values}}
*/
*/
inline
char
*
get
CommandValues
(
const
char
*
pCommand
)
inline
char
*
get
Styles
(
)
{
{
return
mpDoc
->
pClass
->
get
CommandValues
(
mpDoc
,
pCommand
);
return
mpDoc
->
pClass
->
get
Styles
(
mpDoc
);
}
}
#endif // LOK_USE_UNSTABLE_API
#endif // LOK_USE_UNSTABLE_API
};
};
...
...
libreofficekit/qa/unit/tiledrendering.cxx
Dosyayı görüntüle @
262e7be0
...
@@ -195,16 +195,12 @@ void TiledRenderingTest::testGetStyles( Office* pOffice )
...
@@ -195,16 +195,12 @@ void TiledRenderingTest::testGetStyles( Office* pOffice )
scoped_ptr
<
Document
>
pDocument
(
pOffice
->
documentLoad
(
sDocPath
.
c_str
()
)
);
scoped_ptr
<
Document
>
pDocument
(
pOffice
->
documentLoad
(
sDocPath
.
c_str
()
)
);
boost
::
property_tree
::
ptree
aTree
;
boost
::
property_tree
::
ptree
aTree
;
char
*
pJSON
=
pDocument
->
get
CommandValues
(
".uno:StyleApply"
);
char
*
pJSON
=
pDocument
->
get
Styles
(
);
std
::
stringstream
aStream
(
pJSON
);
std
::
stringstream
aStream
(
pJSON
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
CPPUNIT_ASSERT
(
aTree
.
size
()
>
0
);
CPPUNIT_ASSERT
(
aTree
.
size
()
>
0
);
CPPUNIT_ASSERT
(
aTree
.
get_value
<
std
::
string
>
(
"commandName"
)
==
".uno:StyleApply"
);
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aTree
)
boost
::
property_tree
::
ptree
aValues
=
aTree
.
get_child
(
"commandValues"
);
CPPUNIT_ASSERT
(
aValues
.
size
()
>
0
);
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aValues
)
{
{
CPPUNIT_ASSERT
(
rPair
.
second
.
size
()
>
0
);
CPPUNIT_ASSERT
(
rPair
.
second
.
size
()
>
0
);
if
(
rPair
.
first
!=
"CharacterStyles"
&&
if
(
rPair
.
first
!=
"CharacterStyles"
&&
...
...
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