basegfx/Library_basegfx.mk | 1 basegfx/source/numeric/ftools.cxx | 57 ------ include/basegfx/numeric/ftools.hxx | 11 - sc/source/core/opencl/opencl_device.cxx | 10 - sc/source/ui/inc/printfun.hxx | 7 sc/source/ui/unoobj/shapeuno.cxx | 3 sc/source/ui/view/printfun.cxx | 116 +++++++++----- svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 16 - svx/source/inc/svxpixelctlaccessiblecontext.hxx | 11 - unusedcode.easy | 4 10 files changed, 88 insertions(+), 148 deletions(-)
New commits: commit de2beb35985c9112777d0ca4f5e953a5d494e6d2 Author: Armin Le Grand <[email protected]> Date: Wed Feb 26 03:04:14 2014 +0000 Resolves: #i123672# Made data used in ScPrintFunc to prepare... print preview dynamic (cherry picked from commit 51dac483c90f5d33fab5f449c0915917540ef547) Conflicts: sc/source/ui/inc/printfun.hxx sc/source/ui/view/printfun.cxx Change-Id: I1ec4b29821a958f8ca95d8e770de9971fbc47bae diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx index 59bb0ded..a0306b0 100644 --- a/sc/source/ui/inc/printfun.hxx +++ b/sc/source/ui/inc/printfun.hxx @@ -188,9 +188,10 @@ private: SCCOL nEndCol; SCROW nEndRow; - SCCOL* pPageEndX; // page layout - SCROW* pPageEndY; - ScPageRowEntry* pPageRows; + std::vector< SCCOL > maPageEndX; + std::vector< SCROW > maPageEndY; + std::vector< ScPageRowEntry> maPageRows; + size_t nPagesX; size_t nPagesY; size_t nTotalY; diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index c09e8cc..53b61b2 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -842,7 +842,8 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } else { - GetShapePropertySet(); + if(!pShapePropertySet) //performance consideration + GetShapePropertySet(); if (pShapePropertySet) aAny = pShapePropertySet->getPropertyValue( aPropertyName ); } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index fe44102..ab56da2 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -181,9 +181,6 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) // else, EditEngine outputs different text heights pDev->SetMapMode(MAP_PIXEL); - pPageEndX = NULL; - pPageEndY = NULL; - pPageRows = NULL; pBorderItem = NULL; pBackgroundItem = NULL; pShadowItem = NULL; @@ -331,8 +328,25 @@ void ScPrintFunc::FillPageData() rData.SetPrintRange( ScRange( nStartCol, nStartRow, nPrintTab, nEndCol, nEndRow, nPrintTab ) ); - rData.SetPagesX( nPagesX, pPageEndX ); - rData.SetPagesY( nTotalY, pPageEndY ); + // #i123672# + if(maPageEndX.empty()) + { + OSL_ENSURE(false, "vector access error for maPageEndX (!)"); + } + else + { + rData.SetPagesX( nPagesX, &maPageEndX[0]); + } + + // #i123672# + if(maPageEndY.empty()) + { + OSL_ENSURE(false, "vector access error for maPageEndY (!)"); + } + else + { + rData.SetPagesY( nTotalY, &maPageEndY[0]); + } // Settings rData.SetTopDown( aTableParam.bTopDown ); @@ -342,9 +356,6 @@ void ScPrintFunc::FillPageData() ScPrintFunc::~ScPrintFunc() { - delete[] pPageEndX; - delete[] pPageEndY; - delete[] pPageRows; delete pEditDefaults; delete pEditEngine; @@ -2439,7 +2450,10 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP CalcZoom(i); if ( aTableParam.bSkipEmpty ) for (nY=0; nY<nPagesY; nY++) - nPages += pPageRows[nY].CountVisible(); + { + OSL_ENSURE(nY < maPageRows.size(), "vector access error for maPageRows (!)"); + nPages += maPageRows[nY].CountVisible(); + } else nPages += ((long) nPagesX) * nPagesY; if ( pPageData ) @@ -2451,7 +2465,10 @@ long ScPrintFunc::CountPages() // sets also nPagesX, nP CalcZoom(RANGENO_NORANGE); // calculate Zoom if ( aTableParam.bSkipEmpty ) for (nY=0; nY<nPagesY; nY++) - nPages += pPageRows[nY].CountVisible(); + { + OSL_ENSURE(nY < maPageRows.size(), "vector access error for maPageRows (!)"); + nPages += maPageRows[nY].CountVisible(); + } else nPages += ((long) nPagesX) * nPagesY; if ( pPageData ) @@ -2651,12 +2668,14 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges, nX1 = nStartCol; for (nCountX=0; nCountX<nPagesX; nCountX++) { - nX2 = pPageEndX[nCountX]; + OSL_ENSURE(nCountX < maPageEndX.size(), "vector access error for maPageEndX (!)"); + nX2 = maPageEndX[nCountX]; for (nCountY=0; nCountY<nPagesY; nCountY++) { - nY1 = pPageRows[nCountY].GetStartRow(); - nY2 = pPageRows[nCountY].GetEndRow(); - if ( !aTableParam.bSkipEmpty || !pPageRows[nCountY].IsHidden(nCountX) ) + OSL_ENSURE(nCountY < maPageRows.size(), "vector access error for maPageRows (!)"); + nY1 = maPageRows[nCountY].GetStartRow(); + nY2 = maPageRows[nCountY].GetEndRow(); + if ( !aTableParam.bSkipEmpty || !maPageRows[nCountY].IsHidden(nCountX) ) { if ( rPageRanges.IsSelected( nPageNo+nStartPage+1 ) ) { @@ -2674,13 +2693,15 @@ long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges, { for (nCountY=0; nCountY<nPagesY; nCountY++) { - nY1 = pPageRows[nCountY].GetStartRow(); - nY2 = pPageRows[nCountY].GetEndRow(); + OSL_ENSURE(nCountY < maPageRows.size(), "vector access error for maPageRows (!)"); + nY1 = maPageRows[nCountY].GetStartRow(); + nY2 = maPageRows[nCountY].GetEndRow(); nX1 = nStartCol; for (nCountX=0; nCountX<nPagesX; nCountX++) { - nX2 = pPageEndX[nCountX]; - if ( !aTableParam.bSkipEmpty || !pPageRows[nCountY].IsHidden(nCountX) ) + OSL_ENSURE(nCountX < maPageEndX.size(), "vector access error for maPageEndX (!)"); + nX2 = maPageEndX[nCountX]; + if ( !aTableParam.bSkipEmpty || !maPageRows[nCountY].IsHidden(nCountX) ) { if ( rPageRanges.IsSelected( nPageNo+nStartPage+1 ) ) { @@ -2934,7 +2955,7 @@ void ScPrintFunc::ResetBreaks( SCTAB nTab ) // Set Breaks correctly for } static void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowEntry, - SCCOL nStartCol, const SCCOL* pPageEndX ) + SCCOL nStartCol, const std::vector< SCCOL >& rPageEndX ) { size_t nPagesX = rPageRowEntry.GetPagesX(); SCROW nStartRow = rPageRowEntry.GetStartRow(); @@ -2946,7 +2967,8 @@ static void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rP for (size_t i=0; i<nPagesX; i++) { - SCCOL nEndCol = pPageEndX[i]; + OSL_ENSURE(i < rPageEndX.size(), "vector access error for maPageEndX (!)"); + SCCOL nEndCol = rPageEndX[i]; if ( pDoc->IsPrintEmpty( nPrintTab, nStartCol, nStartRow, nEndCol, nEndRow, bLeftIsEmpty, &aTempRange, &aTempRect ) ) { @@ -2962,9 +2984,11 @@ static void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rP void ScPrintFunc::CalcPages() // calculates aPageRect and pages from nZoom { - if (!pPageEndX) pPageEndX = new SCCOL[MAXCOL+1]; - if (!pPageEndY) pPageEndY = new SCROW[MAXROW+1]; - if (!pPageRows) pPageRows = new ScPageRowEntry[MAXROW+1]; //! count before !!!! + // #i123672# use dynamic mem to react on size changes + if (maPageEndX.size() < MAXCOL+1) + { + maPageEndX.resize(MAXCOL+1, SCCOL()); + } pDoc->SetPageSize( nPrintTab, GetDocPageSize() ); if (aAreaParam.bPrintArea) @@ -2973,7 +2997,23 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr pDoc->UpdatePageBreaks( nPrintTab, &aRange ); } else + { pDoc->UpdatePageBreaks( nPrintTab, NULL ); // else, end is marked + } + + const size_t nRealCnt = nEndRow-nStartRow+1; + + // #i123672# use dynamic mem to react on size changes + if (maPageEndY.size() < nRealCnt+1) + { + maPageEndY.resize(nRealCnt+1, SCROW()); + } + + // #i123672# use dynamic mem to react on size changes + if (maPageRows.size() < nRealCnt+1) + { + maPageRows.resize(nRealCnt+1, ScPageRowEntry()); + } // // Page alignment/splitting after breaks in Col/RowFlags @@ -2991,7 +3031,8 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr bool bPageBreak = (pDoc->HasColBreak(i, nPrintTab) & BREAK_PAGE); if ( i>nStartCol && bVisCol && bPageBreak ) { - pPageEndX[nPagesX] = i-1; + OSL_ENSURE(nPagesX < maPageEndX.size(), "vector access error for maPageEndX (!)"); + maPageEndX[nPagesX] = i-1; ++nPagesX; bVisCol = false; } @@ -3000,7 +3041,8 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr } if (bVisCol) // also at the end, no empty pages { - pPageEndX[nPagesX] = nEndCol; + OSL_ENSURE(nPagesX < maPageEndX.size(), "vector access error for maPageEndX (!)"); + maPageEndX[nPagesX] = nEndCol; ++nPagesX; } @@ -3022,17 +3064,19 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr if (nRow > nStartRow && bVisRow && bPageBreak ) { - pPageEndY[nTotalY] = nRow-1; + OSL_ENSURE(nTotalY < maPageEndY.size(), "vector access error for maPageEndY (!)"); + maPageEndY[nTotalY] = nRow-1; ++nTotalY; if ( !aTableParam.bSkipEmpty || !pDoc->IsPrintEmpty( nPrintTab, nStartCol, nPageStartRow, nEndCol, nRow-1 ) ) { - pPageRows[nPagesY].SetStartRow( nPageStartRow ); - pPageRows[nPagesY].SetEndRow( nRow-1 ); - pPageRows[nPagesY].SetPagesX( nPagesX ); + OSL_ENSURE(nPagesY < maPageRows.size(), "vector access error for maPageRows (!)"); + maPageRows[nPagesY].SetStartRow( nPageStartRow ); + maPageRows[nPagesY].SetEndRow( nRow-1 ); + maPageRows[nPagesY].SetPagesX( nPagesX ); if (aTableParam.bSkipEmpty) - lcl_SetHidden( pDoc, nPrintTab, pPageRows[nPagesY], nStartCol, pPageEndX ); + lcl_SetHidden( pDoc, nPrintTab, maPageRows[nPagesY], nStartCol, maPageEndX ); ++nPagesY; } @@ -3061,17 +3105,19 @@ void ScPrintFunc::CalcPages() // calculates aPageRect and pages fr if (bVisRow) { - pPageEndY[nTotalY] = nEndRow; + OSL_ENSURE(nTotalY < maPageEndY.size(), "vector access error for maPageEndY (!)"); + maPageEndY[nTotalY] = nEndRow; ++nTotalY; if ( !aTableParam.bSkipEmpty || !pDoc->IsPrintEmpty( nPrintTab, nStartCol, nPageStartRow, nEndCol, nEndRow ) ) { - pPageRows[nPagesY].SetStartRow( nPageStartRow ); - pPageRows[nPagesY].SetEndRow( nEndRow ); - pPageRows[nPagesY].SetPagesX( nPagesX ); + OSL_ENSURE(nPagesY < maPageRows.size(), "vector access error for maPageRows (!)"); + maPageRows[nPagesY].SetStartRow( nPageStartRow ); + maPageRows[nPagesY].SetEndRow( nEndRow ); + maPageRows[nPagesY].SetPagesX( nPagesX ); if (aTableParam.bSkipEmpty) - lcl_SetHidden( pDoc, nPrintTab, pPageRows[nPagesY], nStartCol, pPageEndX ); + lcl_SetHidden( pDoc, nPrintTab, maPageRows[nPagesY], nStartCol, maPageEndX ); ++nPagesY; } } commit 978fb3ed2779d8a2e64e8033c7931f36cb0edb6b Author: Caolán McNamara <[email protected]> Date: Wed Feb 26 09:22:17 2014 +0000 we can do away with mfSmallValue Change-Id: Ia3ae16d71d1044ef9f338cd4322b371bdffd8e2e diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk index f121f69..de2430c 100644 --- a/basegfx/Library_basegfx.mk +++ b/basegfx/Library_basegfx.mk @@ -37,7 +37,6 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\ basegfx/source/matrix/b2dhommatrix \ basegfx/source/matrix/b2dhommatrixtools \ basegfx/source/matrix/b3dhommatrix \ - basegfx/source/numeric/ftools \ basegfx/source/pixel/bpixel \ basegfx/source/point/b2dpoint \ basegfx/source/point/b2ipoint \ diff --git a/basegfx/source/numeric/ftools.cxx b/basegfx/source/numeric/ftools.cxx deleted file mode 100644 index 83bacc9..0000000 --- a/basegfx/source/numeric/ftools.cxx +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- 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 <basegfx/numeric/ftools.hxx> -#include <algorithm> - -namespace basegfx -{ - // init static member of class fTools - double ::basegfx::fTools::mfSmallValue = 0.000000001; - -} // end of namespace basegfx - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index dc38879..5cb42c0 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -149,14 +149,9 @@ namespace basegfx class BASEGFX_DLLPUBLIC fTools { - /// Threshold value for equalZero() - static double mfSmallValue; - public: /// Get threshold value for equalZero and friends - static double getSmallValue() { return mfSmallValue; } - /// Set threshold value for equalZero and friends - static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; } + static double getSmallValue() { return 0.000000001f; } /// Compare against small value static bool equalZero(const double& rfVal) commit c5bcfe902d1c4be488a1ce0ffb44a4f54734b2d5 Author: Caolán McNamara <[email protected]> Date: Wed Feb 26 09:16:44 2014 +0000 callcatcher: update unused code Change-Id: I2d79938465800a6bfe8cc120b85dc449ff04a960 diff --git a/basegfx/source/numeric/ftools.cxx b/basegfx/source/numeric/ftools.cxx index 6816fb3..83bacc9 100644 --- a/basegfx/source/numeric/ftools.cxx +++ b/basegfx/source/numeric/ftools.cxx @@ -25,33 +25,6 @@ namespace basegfx // init static member of class fTools double ::basegfx::fTools::mfSmallValue = 0.000000001; - double snapToZeroRange(double v, double fWidth) - { - if(fTools::equalZero(fWidth)) - { - // with no range all snaps to range bound - return 0.0; - } - else - { - if(v < 0.0 || v > fWidth) - { - double fRetval(fmod(v, fWidth)); - - if(fRetval < 0.0) - { - fRetval += fWidth; - } - - return fRetval; - } - else - { - return v; - } - } - } - } // end of namespace basegfx /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index 5ce21f7..dc38879 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -136,10 +136,6 @@ namespace basegfx return v / M_PI_2 * 90.0; } - /** Snap v to the range [0.0 .. fWidth] using modulo - */ - double snapToZeroRange(double v, double fWidth); - /** return fValue with the sign of fSignCarrier, thus evtl. changed */ inline double copySign(double fValue, double fSignCarrier) diff --git a/sc/source/core/opencl/opencl_device.cxx b/sc/source/core/opencl/opencl_device.cxx index 79e2396..1a5edc5 100644 --- a/sc/source/core/opencl/opencl_device.cxx +++ b/sc/source/core/opencl/opencl_device.cxx @@ -565,16 +565,6 @@ ds_device getDeviceSelection(const char* sProfilePath, bool bForceSelection) return selectedDevice; } -bool selectedDeviceIsOpenCL(ds_device device) -{ - return (DS_DEVICE_OPENCL_DEVICE == device.type); -} - -bool selectedDeviceIsNativeCPU(ds_device device) -{ - return (DS_DEVICE_NATIVE_CPU == device.type); -} - }} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 45a3df4..2893521 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -379,22 +379,6 @@ void SvxPixelCtlAccessible::ensureIsAlive() const throw lang::DisposedException(); } -void SvxPixelCtlAccessible::ensureIsValidRow( sal_Int32 nRow ) - throw ( lang::IndexOutOfBoundsException ) -{ - if( nRow >= mrPixelCtl.GetHeight() || nRow <0) - throw lang::IndexOutOfBoundsException( - OUString( RTL_CONSTASCII_USTRINGPARAM( "row index is invalid" ) ), *this ); -} - -void SvxPixelCtlAccessible::ensureIsValidColumn( sal_Int32 nColumn ) - throw ( lang::IndexOutOfBoundsException ) -{ - if( nColumn >= mrPixelCtl.GetWidth() || nColumn <0 ) - throw lang::IndexOutOfBoundsException( - OUString( RTL_CONSTASCII_USTRINGPARAM("column index is invalid") ), *this ); -} - //XAccessibleEventBroadcaster void SAL_CALL SvxPixelCtlAccessible::addAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw( RuntimeException ) { diff --git a/svx/source/inc/svxpixelctlaccessiblecontext.hxx b/svx/source/inc/svxpixelctlaccessiblecontext.hxx index 2c887b7..0b8a835 100644 --- a/svx/source/inc/svxpixelctlaccessiblecontext.hxx +++ b/svx/source/inc/svxpixelctlaccessiblecontext.hxx @@ -249,17 +249,6 @@ public: inline sal_Bool IsNotAlive( void ) const; protected: - /** @attention This method requires locked mutex's and a living object. - @throws <type>IndexOutOfBoundsException</type> - If the specified row index is invalid. */ - void ensureIsValidRow( sal_Int32 nRow ) - throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws <type>IndexOutOfBoundsException</type> - If the specified column index is invalid. */ - void ensureIsValidColumn( sal_Int32 nColumn ) - throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> m_xCurChild; public: void NotifyChild(long nIndex,sal_Bool bSelect ,sal_Bool bCheck); diff --git a/unusedcode.easy b/unusedcode.easy index d9f5038..15d9659 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -22,7 +22,6 @@ GDriveDocument::GDriveDocument(GDriveSession*) GDriveFolder::GDriveFolder(GDriveSession*) GDriveProperty::GDriveProperty() GDriveSession::GDriveSession() -ImplImageTree::checkStyle(rtl::OUString const&) ImplRegionBand::IsInside(long, long) ImplRegionBand::IsOver(long, long) ImportExcel::GetLastFormula(short) @@ -306,8 +305,6 @@ sc::CLBuildKernelThread::produce() sc::CellTextAttr::CellTextAttr(unsigned short, unsigned char) sc::ColumnSet::has(short, short) const sc::CompareFunc(double, sc::Compare::Cell const&, sc::CompareOptions*) -sc::OpenCLDevice::selectedDeviceIsNativeCPU(ds_device) -sc::OpenCLDevice::selectedDeviceIsOpenCL(ds_device) sc::opencl::OpenclDevice::getOpenclState() sc::opencl::OpenclDevice::releaseOpenclRunEnv() sc::opencl::OpenclDevice::setOpenclState(int) @@ -315,7 +312,6 @@ sd::LeftDrawPaneShell::RegisterInterface(SfxModule*) sd::LeftImpressPaneShell::RegisterInterface(SfxModule*) sd::framework::Pane::SetWindow(Window*) sd::presenter::PresenterCanvas::copyRect(com::sun::star::uno::Reference<com::sun::star::rendering::XBitmapCanvas> const&, com::sun::star::geometry::RealRectangle2D const&, com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&, com::sun::star::geometry::RealRectangle2D const&, com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&) -sdr::overlay::OverlayRectangle::setSecondPosition(basegfx::B2DPoint const&) sdr::table::Cell::getName() sdr::table::SdrTableObj::getRowCount() const sfx2::sidebar::ContextList::IsEmpty()
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
