[Libreoffice-commits] core.git: 6 commits - include/sfx2 include/svtools include/svx RepositoryExternal.mk sc/inc sc/source svx/inc svx/source sw/inc sw/source tools/source
David Tardon
dtardon at redhat.com
Tue Oct 14 08:57:10 PDT 2014
RepositoryExternal.mk | 1 +
include/sfx2/ipclient.hxx | 5 ++---
include/sfx2/viewfrm.hxx | 3 ++-
include/sfx2/viewsh.hxx | 2 +-
include/svtools/imap.hxx | 2 +-
include/svtools/imapcirc.hxx | 4 ++--
include/svtools/imappoly.hxx | 4 ++--
include/svtools/imaprect.hxx | 4 ++--
include/svx/sdr/properties/properties.hxx | 3 ++-
sc/inc/column.hxx | 2 +-
sc/inc/patattr.hxx | 3 ++-
sc/source/ui/inc/drawutil.hxx | 3 ++-
svx/inc/sdr/properties/itemsettools.hxx | 7 +++----
svx/source/svdraw/svdoashp.cxx | 6 ++----
svx/source/svdraw/svdobj.cxx | 4 ++--
svx/source/svdraw/svdocirc.cxx | 4 ++--
svx/source/svdraw/svdograf.cxx | 4 ++--
svx/source/svdraw/svdogrp.cxx | 8 ++++----
svx/source/svdraw/svdotxtr.cxx | 4 ++--
svx/source/svdraw/svdview.cxx | 6 ++++--
svx/source/unodraw/unoshape.cxx | 8 ++++++--
sw/inc/pagepreviewlayout.hxx | 2 +-
sw/source/core/inc/viewimp.hxx | 2 +-
tools/source/generic/rational.cxx | 4 ++--
24 files changed, 51 insertions(+), 44 deletions(-)
New commits:
commit a3dc4db870ac3c08c480131ed18d144e42ec18b2
Author: David Tardon <dtardon at redhat.com>
Date: Tue Oct 14 15:43:23 2014 +0200
make sure the denominator is not 0
Change-Id: Ia618379a8d33048b6716f22ad1e5dcbca0bbf307
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index c3d17a5..3fb2591 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1219,8 +1219,12 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
if(mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_MEASURE )
{
- boost::rational<long> aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left());
- boost::rational<long> aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
+ boost::rational<long> aWdt;
+ if (aRect.Right()-aRect.Left() > 0)
+ aWdt.assign(aLocalSize.Width(),aRect.Right()-aRect.Left());
+ boost::rational<long> aHgt;
+ if (aRect.Bottom()-aRect.Top() > 0)
+ aHgt.assign(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
Point aPt = mpObj->GetSnapRect().TopLeft();
mpObj->Resize(aPt,aWdt,aHgt);
}
commit e19fb51d89fd8fa747594ba7aa3fdac67262f646
Author: David Tardon <dtardon at redhat.com>
Date: Tue Oct 14 15:36:26 2014 +0200
make sure the denominator is not 0
Change-Id: Ic32e0f354bb290ad77f1d7709bee89858e1889b7
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index e3a50cd..19f9834 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <algorithm>
+
#include <editeng/eeitem.hxx>
#include "svx/svdstr.hrc"
@@ -478,8 +480,8 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
// account for FitToSize
bool bFitToSize(pTextObj->IsFitToSize());
if (bFitToSize) {
- boost::rational<long> aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1);
- boost::rational<long> aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1);
+ boost::rational<long> aX(aTextRect.GetWidth()-1, std::max(aAnchor.GetWidth()-1, 1L));
+ boost::rational<long> aY(aTextRect.GetHeight()-1, std::max(aAnchor.GetHeight()-1, 1L));
ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY);
}
// account for rotation
commit ad1f796b1dc710a02ade17c95e99d11412f1280a
Author: David Tardon <dtardon at redhat.com>
Date: Tue Oct 14 15:26:44 2014 +0200
simplify condition
Change-Id: Idceac888c57cc27142877d0cf83dd525ab3f92ca
diff --git a/tools/source/generic/rational.cxx b/tools/source/generic/rational.cxx
index fd1fbea..73b9f4e 100644
--- a/tools/source/generic/rational.cxx
+++ b/tools/source/generic/rational.cxx
@@ -116,7 +116,7 @@ static int impl_NumberOfBits( unsigned long nNum )
*/
void rational_ReduceInaccurate(boost::rational<long>& rRational, unsigned nSignificantBits)
{
- if ( !rRational.numerator() || !rRational.denominator() )
+ if ( !rRational )
return;
// Count with unsigned longs only
commit 8afab33d161ddd39a3e6094b5daa08b156ef0421
Author: David Tardon <dtardon at redhat.com>
Date: Tue Oct 14 15:21:44 2014 +0200
just check if the fraction is < 0
Change-Id: I23f631898f29d8285d3da333686da8d3f28a00f8
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 858772c..454b73c 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1583,13 +1583,11 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const boost::rational<long
if ( ( xFact.numerator() != xFact.denominator() )
|| ( yFact.numerator()!= yFact.denominator() ) )
{
- if ( ( ( xFact.numerator() < 0 ) && ( xFact.denominator() > 0 ) ) ||
- ( ( xFact.numerator() > 0 ) && ( xFact.denominator() < 0 ) ) )
+ if ( xFact < 0 )
{
SetMirroredX( IsMirroredX() == false );
}
- if ( ( ( yFact.numerator() < 0 ) && ( yFact.denominator() > 0 ) ) ||
- ( ( yFact.numerator() > 0 ) && ( yFact.denominator() < 0 ) ) )
+ if ( yFact < 0 )
{
SetMirroredY( IsMirroredY() == false );
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c98acb0..2cd9069 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1497,8 +1497,8 @@ void SdrObject::NbcMove(const Size& rSiz)
void SdrObject::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact)
{
- bool bXMirr = xFact.numerator() < 0;
- bool bYMirr = yFact.numerator() < 0;
+ bool bXMirr = xFact < 0;
+ bool bYMirr = yFact < 0;
if (bXMirr || bYMirr) {
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 81a9c41..2a07296 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -818,8 +818,8 @@ void SdrCircObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact
SdrTextObj::NbcResize(rRef,xFact,yFact);
bNoShearRota|=(aGeo.nDrehWink==0 && aGeo.nShearWink==0);
if (meCircleKind!=OBJ_CIRC) {
- bool bXMirr = xFact.numerator() < 0;
- bool bYMirr = yFact.numerator() < 0;
+ bool bXMirr = xFact < 0;
+ bool bYMirr = yFact < 0;
if (bXMirr || bYMirr) {
// At bXMirr!=bYMirr we should actually swap both line ends.
// That, however, is pretty bad (because of forced "hard" formatting).
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index b101d03..50abaeb 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -901,8 +901,8 @@ void SdrGrafObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact
{
SdrRectObj::NbcResize( rRef, xFact, yFact );
- bool bMirrX = xFact.numerator() < 0;
- bool bMirrY = yFact.numerator() < 0;
+ bool bMirrX = xFact < 0;
+ bool bMirrY = yFact < 0;
if( bMirrX != bMirrY )
bMirrored = !bMirrored;
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index dd79cc4..a624269 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -438,8 +438,8 @@ void SdrObjGroup::NbcMove(const Size& rSiz)
void SdrObjGroup::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact)
{
- bool bXMirr = xFact.numerator() < 0;
- bool bYMirr = yFact.numerator() < 0;
+ bool bXMirr = xFact < 0;
+ bool bYMirr = yFact < 0;
if (bXMirr || bYMirr) {
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
@@ -590,8 +590,8 @@ void SdrObjGroup::Move(const Size& rSiz)
void SdrObjGroup::Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative)
{
if (xFact.numerator()!=xFact.denominator() || yFact.numerator()!=yFact.denominator()) {
- bool bXMirr = xFact.numerator() < 0;
- bool bYMirr = yFact.numerator() < 0;
+ bool bXMirr = xFact < 0;
+ bool bYMirr = yFact < 0;
if (bXMirr || bYMirr) {
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index b627d59..e747b3e 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -126,8 +126,8 @@ void SdrTextObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact
long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
long nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
long nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
- bool bXMirr = xFact.numerator() < 0;
- bool bYMirr = yFact.numerator() < 0;
+ bool bXMirr = xFact < 0;
+ bool bYMirr = yFact < 0;
if (bXMirr || bYMirr) {
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
diff --git a/tools/source/generic/rational.cxx b/tools/source/generic/rational.cxx
index 30690be..fd1fbea 100644
--- a/tools/source/generic/rational.cxx
+++ b/tools/source/generic/rational.cxx
@@ -121,7 +121,7 @@ void rational_ReduceInaccurate(boost::rational<long>& rRational, unsigned nSigni
// Count with unsigned longs only
// http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
- const bool bNeg = ( rRational.numerator() < 0 );
+ const bool bNeg = ( rRational < 0 );
unsigned long nMul = (unsigned long)( bNeg? -rRational.numerator(): rRational.numerator() );
unsigned long nDiv = (unsigned long)( rRational.denominator() );
commit 091742e86aeb5287f7236f666fee48946ab4c67b
Author: David Tardon <dtardon at redhat.com>
Date: Tue Oct 14 14:38:33 2014 +0200
do not forward-declare templates
Change-Id: I3b0a145f70406f0c8a12b6c4b7876c4148f76e93
diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index 350c7ac..573d899 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -19,6 +19,8 @@
#ifndef INCLUDED_SFX2_IPCLIENT_HXX
#define INCLUDED_SFX2_IPCLIENT_HXX
+#include <boost/rational.hpp>
+
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sal/types.h>
@@ -34,9 +36,6 @@ class SfxInPlaceClient_Impl;
class SfxViewShell;
class SfxObjectShell;
namespace vcl { class Window; }
-namespace boost { template<typename T> class rational; }
-
-
class SFX2_DLLPUBLIC SfxInPlaceClient
{
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 9acc0e2..426a9fd 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -19,6 +19,8 @@
#ifndef INCLUDED_SFX2_VIEWFRM_HXX
#define INCLUDED_SFX2_VIEWFRM_HXX
+#include <boost/rational.hpp>
+
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sal/types.h>
@@ -43,7 +45,6 @@ class SfxProgress;
class SvData;
class SfxViewShell;
class SystemWindow;
-namespace boost { template<typename T> class rational; }
class Point;
class Size;
class SfxChildWindow;
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 827bdfd..39e5f2c 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -35,11 +35,11 @@
#include <tools/gen.hxx>
#include <tools/errcode.hxx>
#include <vcl/jobset.hxx>
+#include <boost/rational.hpp>
#include <vector>
class SfxBaseController;
class Size;
-namespace boost { template<typename T> class rational; }
namespace vcl { class Window; }
class KeyEvent;
class WorkWindow;
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 37a5133..29b5de5 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -22,12 +22,12 @@
#include <svtools/svtdllapi.h>
#include <tools/stream.hxx>
+#include <boost/rational.hpp>
#include <vector>
class Point;
class Rectangle;
class Size;
-namespace boost { template<typename T> class rational; }
class IMapObject;
typedef ::std::vector< IMapObject* > IMapObjectList_impl;
diff --git a/include/svtools/imapcirc.hxx b/include/svtools/imapcirc.hxx
index fd6c164..003a2e1 100644
--- a/include/svtools/imapcirc.hxx
+++ b/include/svtools/imapcirc.hxx
@@ -19,12 +19,12 @@
#ifndef INCLUDED_SVTOOLS_IMAPCIRC_HXX
#define INCLUDED_SVTOOLS_IMAPCIRC_HXX
+#include <boost/rational.hpp>
+
#include <svtools/svtdllapi.h>
#include <tools/gen.hxx>
#include <svtools/imapobj.hxx>
-namespace boost { template<typename T> class rational; }
-
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
{
Point aCenter;
diff --git a/include/svtools/imappoly.hxx b/include/svtools/imappoly.hxx
index e01b311..40fff04 100644
--- a/include/svtools/imappoly.hxx
+++ b/include/svtools/imappoly.hxx
@@ -20,12 +20,12 @@
#ifndef INCLUDED_SVTOOLS_IMAPPOLY_HXX
#define INCLUDED_SVTOOLS_IMAPPOLY_HXX
+#include <boost/rational.hpp>
+
#include <svtools/svtdllapi.h>
#include <svtools/imapobj.hxx>
#include <tools/poly.hxx>
-namespace boost { template<typename T> class rational; }
-
class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
{
Polygon aPoly;
diff --git a/include/svtools/imaprect.hxx b/include/svtools/imaprect.hxx
index 6855fb3..48dff3c 100644
--- a/include/svtools/imaprect.hxx
+++ b/include/svtools/imaprect.hxx
@@ -19,12 +19,12 @@
#ifndef INCLUDED_SVTOOLS_IMAPRECT_HXX
#define INCLUDED_SVTOOLS_IMAPRECT_HXX
+#include <boost/rational.hpp>
+
#include <svtools/svtdllapi.h>
#include <svtools/imapobj.hxx>
#include <tools/gen.hxx>
-namespace boost { template<typename T> class rational; }
-
class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
{
Rectangle aRect;
diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx
index 2bb32df..6ce22f6 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX
#define INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX
+#include <boost/rational.hpp>
+
#include <sal/types.h>
#include <svx/svxdllapi.h>
@@ -30,7 +32,6 @@ class SdrObject;
class SfxItemSet;
class SfxPoolItem;
class SfxStyleSheet;
-namespace boost { template<typename T> class rational; }
class SfxItemPool;
class SdrModel;
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 6c33f74..50204b3 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -34,6 +34,7 @@
#include <vector>
#include <boost/intrusive_ptr.hpp>
+#include <boost/rational.hpp>
#include <mdds/flat_segment_tree.hpp>
namespace editeng { class SvxBorderLine; }
@@ -69,7 +70,6 @@ class RefMovedHint;
}
-namespace boost { template<typename T> class rational; }
class OutputDevice;
class SfxItemPoolCache;
class SvtListener;
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 67b07f5..66bdc7e 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_INC_PATATTR_HXX
#define INCLUDED_SC_INC_PATATTR_HXX
+#include <boost/rational.hpp>
+
#include <svl/poolitem.hxx>
#include <svl/itemset.hxx>
#include <unotools/fontcvt.hxx>
@@ -28,7 +30,6 @@
namespace vcl { class Font; }
class OutputDevice;
-namespace boost { template<class T> class rational; }
class ScStyleSheet;
class SvNumberFormatter;
class ScDocument;
diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx
index 740ee03..15ef550 100644
--- a/sc/source/ui/inc/drawutil.hxx
+++ b/sc/source/ui/inc/drawutil.hxx
@@ -20,9 +20,10 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_DRAWUTIL_HXX
#define INCLUDED_SC_SOURCE_UI_INC_DRAWUTIL_HXX
+#include <boost/rational.hpp>
+
#include "address.hxx"
-namespace boost { template<typename T> class rational; }
class OutputDevice;
class ScDocument;
diff --git a/svx/inc/sdr/properties/itemsettools.hxx b/svx/inc/sdr/properties/itemsettools.hxx
index ef36572..ff745bf 100644
--- a/svx/inc/sdr/properties/itemsettools.hxx
+++ b/svx/inc/sdr/properties/itemsettools.hxx
@@ -1,5 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
+/* -*- 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
@@ -20,6 +19,8 @@
#ifndef INCLUDED_SVX_INC_SDR_PROPERTIES_ITEMSETTOOLS_HXX
#define INCLUDED_SVX_INC_SDR_PROPERTIES_ITEMSETTOOLS_HXX
+#include <boost/rational.hpp>
+
#include <sal/types.h>
@@ -28,8 +29,6 @@
class SdrObject;
class SfxItemSet;
class Rectangle;
-namespace boost { template<class T> class rational; }
-
// class to remember broadcast start positions
namespace sdr
diff --git a/sw/inc/pagepreviewlayout.hxx b/sw/inc/pagepreviewlayout.hxx
index 90488a1..60a5543 100644
--- a/sw/inc/pagepreviewlayout.hxx
+++ b/sw/inc/pagepreviewlayout.hxx
@@ -22,6 +22,7 @@
// template class <std::vector>
#include <vector>
+#include <boost/rational.hpp>
// datatypes sal_xyz
#include <sal/types.h>
// classes <Point>, <Size> and <Rectangle>
@@ -32,7 +33,6 @@
class SwViewShell;
class SwRootFrm;
class SwPageFrm;
-namespace boost { template<typename T> class rational; }
struct PreviewPage;
/** page preview functionality in the writer
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index ae86642..a196987 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -25,6 +25,7 @@
#include <vcl/timer.hxx>
#include <swrect.hxx>
#include <swtypes.hxx>
+#include <boost/rational.hpp>
#include <vector>
class SwViewShell;
@@ -40,7 +41,6 @@ class SwPageFrm;
class SwRegionRects;
class SwAccessibleMap;
class SdrObject;
-namespace boost { template<typename T> class rational; }
class SwPrintData;
class SwPagePreviewLayout;
struct PreviewPage;
commit 92f66c5813c34ed470cc00f0d83ed4d80ab39f5c
Author: David Tardon <dtardon at redhat.com>
Date: Mon Oct 13 16:59:33 2014 +0200
add missing dep for saxparser
Change-Id: I93914949cbb20187c48d9771fd98d54602211c13
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index daaf2fc..5277aea 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3763,6 +3763,7 @@ endef
define gb_Executable__register_saxparser
$(call gb_Executable_add_runtime_dependencies,saxparser,\
$(call gb_Library_get_target,$(gb_CPPU_ENV)_uno) \
+ $(call gb_Package_get_target_for_build,instsetoo_native_setup_ure) \
$(call gb_Rdb_get_target_for_build,saxparser) \
$(call gb_Rdb_get_target_for_build,ure/services) \
$(INSTROOT)/$(LIBO_URE_SHARE_FOLDER)/misc/services.rdb \
More information about the Libreoffice-commits
mailing list