Kaydet (Commit) e530689e authored tarafından brainbreaker's avatar brainbreaker Kaydeden (comit) Miklos Vajna

Clean up android specific template functions defined in std namespace

Change-Id: I2094ee8eec00587f166d96723a02eb5957dbf79b
Reviewed-on: https://gerrit.libreoffice.org/39890Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 6b0cace6
......@@ -85,6 +85,7 @@
#include <sfx2/sfxbasemodel.hxx>
#include <svl/undo.hxx>
#include <unotools/datetime.hxx>
#include <android/compatibility.hxx>
#include <app.hxx>
......@@ -102,25 +103,6 @@ using namespace vcl;
using namespace desktop;
using namespace utl;
#if defined(ANDROID)
namespace std
{
template<typename T>
std::string to_string(T x)
{
std::ostringstream stream;
stream << x;
return stream.str();
}
long stol( const std::string& str, std::size_t* /*pos*/ = 0, int base = 10 )
{
char* end;
return strtol(str.c_str(), &end, base);
}
}
#endif
static LibLibreOffice_Impl *gImpl = nullptr;
static std::weak_ptr< LibreOfficeKitClass > gOfficeClass;
static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass;
......
......@@ -26,21 +26,12 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <svtools/borderhelper.hxx>
#include <editeng/borderline.hxx>
#include <android/compatibility.hxx>
#include <algorithm>
#include <cmath>
#include <numeric>
#if defined(ANDROID)
namespace std
{
template<typename T>
T round(T x)
{
return ::round(x);
}
}
#endif
namespace drawinglayer
{
......
......@@ -54,20 +54,10 @@
#include <vcl/window.hxx>
#include <svtools/borderhelper.hxx>
#include <editeng/borderline.hxx>
#include <android/compatibility.hxx>
#include <com/sun/star/table/BorderLineStyle.hpp>
#if defined(ANDROID)
namespace std
{
template<typename T>
T round(T x)
{
return ::round(x);
}
}
#endif
using namespace com::sun::star;
namespace drawinglayer
......
/* -*- 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <math.h>
#if defined(ANDROID)
namespace std
{
inline double fmax(double x, double y)
{
return ::fmax(x, y);
}
inline long stol( const std::string& str, std::size_t* /*pos*/ = 0, int base = 10 )
{
char* end;
return strtol(str.c_str(), &end, base);
}
template<typename T>
T round(T x)
{
return ::round(x);
}
template<typename T>
T trunc(T x)
{
return ::trunc(x);
}
template<typename T>
T lround(T x)
{
return ::lround(x);
}
template<typename T>
T copysign(T x, T y)
{
return ::copysign(x, y);
}
template <typename T> std::string to_string(const T& rNumber)
{
std::ostringstream aStream;
aStream << rNumber;
return aStream.str();
}
}
#endif
\ No newline at end of file
......@@ -90,6 +90,7 @@
#include <svx/svdoashp.hxx>
#include <svx/unoapi.hxx>
#include <svx/unoshape.hxx>
#include <android/compatibility.hxx>
using namespace ::css;
using namespace ::css::beans;
......@@ -104,16 +105,6 @@ using ::css::io::XOutputStream;
using ::sax_fastparser::FSHelperPtr;
using ::sax_fastparser::FastSerializerHelper;
#if defined(ANDROID)
namespace std
{
template<typename T>
T lround(T x)
{
return ::lround(x);
}
}
#endif
namespace oox {
namespace drawingml {
......
......@@ -20,6 +20,8 @@
#include <com/sun/star/util/CellProtection.hpp>
#include "scitems.hxx"
#include <android/compatibility.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/boxitem.hxx>
......@@ -36,22 +38,10 @@
#include "sc.hrc"
#include "mid.hrc"
#include "globstr.hrc"
#include "textuno.hxx"
using namespace com::sun::star;
#ifdef ANDROID
namespace std
{
template <typename T> std::string to_string(const T& rNumber)
{
std::ostringstream aStream;
aStream << rNumber;
return aStream.str();
}
}
#endif
SfxPoolItem* ScProtectionAttr::CreateDefault() { return new ScProtectionAttr; }
SfxPoolItem* ScDoubleItem::CreateDefault() { SAL_WARN( "sc", "No ScDoubleItem factory available"); return nullptr; }
......
......@@ -38,17 +38,7 @@
#include <thread>
#include <comphelper/threadpool.hxx>
#include <oox/export/utils.hxx>
#if defined(ANDROID)
namespace std
{
template<typename T>
T trunc(T x)
{
return ::trunc(x);
}
}
#endif
#include <android/compatibility.hxx>
using namespace ::oox;
......
......@@ -24,16 +24,7 @@
#include <sgvspln.hxx>
#include <cmath>
#if defined(ANDROID)
namespace std
{
template<typename T>
T copysign(T x, T y)
{
return ::copysign(x, y);
}
}
#endif
#include <android/compatibility.hxx>
extern "C" {
......
......@@ -27,17 +27,7 @@
#include <limits>
#include <salgdi.hxx>
#include <unicode/uchar.h>
#if defined(ANDROID)
namespace std
{
template<typename T>
T lround(T x)
{
return ::lround(x);
}
}
#endif
#include <android/compatibility.hxx>
static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
{
......
......@@ -24,6 +24,7 @@
#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/fontcharmap.hxx>
#include <android/compatibility.hxx>
#include "unx/printergfx.hxx"
#include "unx/genpspgraphics.h"
......@@ -38,16 +39,6 @@
#include <cairo-ft.h>
#include "CommonSalLayout.hxx"
#ifdef ANDROID
namespace std
{
double fmax(double x, double y)
{
return ::fmax(x, y);
}
}
#endif
namespace {
typedef struct FT_FaceRec_* FT_Face;
......
......@@ -42,19 +42,10 @@
#include <oox/helper/propertyset.hxx>
#include <boost/logic/tribool.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <android/compatibility.hxx>
using namespace com::sun::star;
#if defined(ANDROID)
namespace std
{
template<typename T>
T lround(T x)
{
return ::lround(x);
}
}
#endif
namespace writerfilter
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment