summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-16 14:14:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-21 07:30:21 +0200
commita04b31c9facb08a8e38b79480b9a73bd2693cb9e (patch)
treead4b216e799831834a12da24b642e6b2d39d491e /desktop/source
parentf2e55ea10676d14c6564696a0648c0edbe4bd36d (diff)
LOK: make getViews() be a member function of Document
Just to be consistent, as all other view-related member functions are there, too. No real impact, as only the unit test uses this so far, and it always works with a single document. Change-Id: I46f1ed8265ab95017986ab45c1b510e961192241
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0548ea3329ef..c4301fd7695e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -251,6 +251,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis);
static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
static int doc_getView(LibreOfficeKitDocument* pThis);
+static int doc_getViews(LibreOfficeKitDocument* pThis);
LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) :
mxComponent( xComponent )
@@ -286,6 +287,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->destroyView = doc_destroyView;
m_pDocumentClass->setView = doc_setView;
m_pDocumentClass->getView = doc_getView;
+ m_pDocumentClass->getViews = doc_getViews;
gDocumentClass = m_pDocumentClass;
}
@@ -313,8 +315,6 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions (LibreOfficeKit* pThi
static void lo_registerCallback (LibreOfficeKit* pThis,
LibreOfficeKitCallback pCallback,
void* pData);
-static int lo_getViews(LibreOfficeKit* pThis);
-
struct LibLibreOffice_Impl : public _LibreOfficeKit
{
OUString maLastExceptionMsg;
@@ -337,7 +337,6 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
m_pOfficeClass->getError = lo_getError;
m_pOfficeClass->documentLoadWithOptions = lo_documentLoadWithOptions;
m_pOfficeClass->registerCallback = lo_registerCallback;
- m_pOfficeClass->getViews = lo_getViews;
gOfficeClass = m_pOfficeClass;
}
@@ -455,11 +454,6 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
pLib->mpCallbackData = pData;
}
-static int lo_getViews(LibreOfficeKit* /*pThis*/)
-{
- return SfxLokHelper::getViews();
-}
-
static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
@@ -1074,6 +1068,13 @@ static int doc_getView(LibreOfficeKitDocument* /*pThis*/)
return SfxLokHelper::getView();
}
+static int doc_getViews(LibreOfficeKitDocument* /*pThis*/)
+{
+ SolarMutexGuard aGuard;
+
+ return SfxLokHelper::getViews();
+}
+
static char* lo_getError (LibreOfficeKit *pThis)
{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);