Skip to content

Commit

Permalink
Move osl::LibreOfficeKit stuff to comphelper for now
Browse files Browse the repository at this point in the history
Let's see where it actually will be needed. Sal is a "picky" place for
new API, even inside LIBO_INTERNAL_ONLY.

Change-Id: Ia0c5ee8cfc6ee526c5ad34d2f8aab0b14b5f805b
  • Loading branch information
Tor Lillqvist committed Apr 2, 2015
1 parent c8cf676 commit cbd8587
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 38 deletions.
1 change: 1 addition & 0 deletions comphelper/Library_comphelper.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/misc/interaction \
comphelper/source/misc/listenernotification \
comphelper/source/misc/logging \
comphelper/source/misc/lok \
comphelper/source/misc/mimeconfighelper \
comphelper/source/misc/namedvaluecollection \
comphelper/source/misc/numberedcollection \
Expand Down
34 changes: 34 additions & 0 deletions comphelper/source/misc/lok.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include <comphelper/lok.hxx>

namespace comphelper
{

namespace LibreOfficeKit
{

static bool bActive(false);

void setActive()
{
bActive = true;
}

bool isActive()
{
return bActive;
}

} // namespace LibreOfficeKit

} // namespace comphelper

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 3 additions & 3 deletions desktop/source/app/officeipcthread.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "dispatchwatcher.hxx"
#include <boost/scoped_ptr.hpp>
#include <stdio.h>
#include <osl/lok.hxx>
#include <osl/process.h>
#include <unotools/bootstrap.hxx>
#include <vcl/svapp.hxx>
Expand All @@ -40,6 +39,7 @@
#include <unotools/moduleoptions.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/file.hxx>
Expand Down Expand Up @@ -467,7 +467,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
// from LibreOfficeKit's lo_initialize() I am not completely sure, but that code, and this, is
// such horrible crack that I don't want to change it too much.

if (osl::LibreOfficeKit::isActive())
if (comphelper::LibreOfficeKit::isActive())
{
// Setting nPipeMode to PIPEMODE_CREATED causes the trivial path to be taken below, starting
// the listeing thread. (Which will immediately finish, see the execute() function, but what
Expand Down Expand Up @@ -707,7 +707,7 @@ void OfficeIPCThread::execute()
#if HAVE_FEATURE_DESKTOP || defined(ANDROID)

#ifndef ANDROID
if (osl::LibreOfficeKit::isActive())
if (comphelper::LibreOfficeKit::isActive())
return;
#endif

Expand Down
4 changes: 2 additions & 2 deletions desktop/source/lib/init.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include <tools/errinf.hxx>
#include <osl/file.hxx>
#include <osl/lok.hxx>
#include <osl/process.h>
#include <osl/thread.h>
#include <rtl/strbuf.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>

#include <com/sun/star/beans/XPropertySet.hpp>
Expand Down Expand Up @@ -853,7 +853,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
if (bInitialized)
return 1;

osl::LibreOfficeKit::setActive();
comphelper::LibreOfficeKit::setActive();

OUString aAppPath;
if (pAppPath)
Expand Down
18 changes: 7 additions & 11 deletions include/osl/lok.hxx → include/comphelper/lok.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#ifndef INCLUDED_OSL_LOK_HXX
#define INCLUDED_OSL_LOK_HXX
#ifndef INCLUDED_COMPHELPER_LOK_HXX
#define INCLUDED_COMPHELPER_LOK_HXX

#ifdef LIBO_INTERNAL_ONLY
#include <comphelper/comphelperdllapi.h>

#include <sal/saldllapi.h>

namespace osl
namespace comphelper
{

namespace LibreOfficeKit
{

SAL_DLLPUBLIC void setActive();
COMPHELPER_DLLPUBLIC void setActive();

SAL_DLLPUBLIC bool isActive();
COMPHELPER_DLLPUBLIC bool isActive();

}
}

#endif // LIBO_INTERNAL_ONLY

#endif // INCLUDED_OSL_LOK_HXX
#endif // INCLUDED_COMPHELPER_LOK_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
17 changes: 0 additions & 17 deletions sal/osl/all/utility.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/

#include <osl/lok.hxx>
#include <osl/time.h>

/*
Expand Down Expand Up @@ -46,22 +45,6 @@ class OGlobalTimer

static OGlobalTimer aGlobalTimer;

namespace LibreOfficeKit
{

static bool bActive(false);

void setActive()
{
bActive = true;
}

bool isActive()
{
return bActive;
}

} // namespace LibreOfficeKit
} // namespace osl

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 0 additions & 5 deletions sal/util/sal.map
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,6 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
_ZN3sal6detail7textenc37handleBadInputUnicodeToTextConversion*;
};

PRIVATE_4.5 { # LibreOffice 4.5
_ZN3osl14LibreOfficeKit8isActive*;
_ZN3osl14LibreOfficeKit9setActive*;
};

# Unique libstdc++ symbols:
GLIBCXX_3.4 {
global:
Expand Down

0 comments on commit cbd8587

Please sign in to comment.