sw/qa/extras/inc/swmodeltestbase.hxx | 10 -------- sw/source/filter/ww8/docxsdrexport.cxx | 9 +++---- vcl/source/gdi/outdev2.cxx | 12 +++++----- vcl/source/window/window.cxx | 39 +++++++++++++++------------------ 4 files changed, 29 insertions(+), 41 deletions(-)
New commits: commit f7c802b46d1c7cafe4c8e0cbec2ce46854862812 Author: Jan Holesovsky <ke...@collabora.com> Date: Mon Mar 24 09:49:01 2014 +0100 No need for a template here. Change-Id: Id56f5c394a4973b9d9464d79a2e94cda38f192de diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 1083477..c80cce0 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -50,10 +50,9 @@ using namespace oox; namespace { -template<class T> -T lclGetProperty(uno::Reference<drawing::XShape> rShape, const OUString& rPropName) +uno::Sequence<beans::PropertyValue> lclGetProperty(uno::Reference<drawing::XShape> rShape, const OUString& rPropName) { - T aResult; + uno::Sequence<beans::PropertyValue> aResult; uno::Reference<beans::XPropertySet> xPropertySet(rShape, uno::UNO_QUERY); uno::Reference<beans::XPropertySetInfo> xPropSetInfo; @@ -73,7 +72,7 @@ OUString lclGetAnchorIdFromGrabBag(const SdrObject* pObj) OUString aResult; uno::Reference<drawing::XShape> xShape(const_cast<SdrObject*>(pObj)->getUnoShape(), uno::UNO_QUERY); uno::Sequence< beans::PropertyValue > propList = - lclGetProperty< uno::Sequence<beans::PropertyValue> >(xShape, "FrameInteropGrabBag"); + lclGetProperty(xShape, "FrameInteropGrabBag"); for (sal_Int32 nProp = 0; nProp < propList.getLength(); ++nProp) { OUString aPropName = propList[nProp].Name; @@ -609,7 +608,7 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrmFmt* bool bLockedCanvas = false; uno::Sequence< beans::PropertyValue > propList = - lclGetProperty< uno::Sequence<beans::PropertyValue> >(xShape, "InteropGrabBag"); + lclGetProperty(xShape, "InteropGrabBag"); for (sal_Int32 nProp=0; nProp < propList.getLength(); ++nProp) { OUString propName = propList[nProp].Name; commit ece15872c8e049a11773083edd80f55fb08b8bf4 Author: Jan Holesovsky <ke...@collabora.com> Date: Mon Mar 24 09:43:39 2014 +0100 Simplify. Change-Id: If20ed2636c9b3cfbfcfe058fe027bd0cc9f8f277 diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index a204ca0..f460800 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -615,15 +615,7 @@ protected: */ void assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rContent) { - xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath); - - CPPUNIT_ASSERT_MESSAGE(OString("XPath '" + rXPath + "' not found").getStr(), - xmlXPathNodeSetGetLength(pXmlNodes) > 0); - - xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - - CPPUNIT_ASSERT_EQUAL_MESSAGE("XPath contents of child does not match", rContent, - OUString::createFromAscii((const char*)((pXmlNode->children[0]).content))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("XPath contents of child does not match", rContent, getXPathContent(pXmlDoc, rXPath)); } /** commit 4365d3c120ec3952e051d31fa94ec25633737fda Author: Jan Holesovsky <ke...@collabora.com> Date: Mon Mar 24 09:28:27 2014 +0100 Decrease indentation by returning early. Change-Id: I9ab5b4dbd28c720c9d7cdd8a1642462643abe94c diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index d20cd78..51ee483 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -377,12 +377,12 @@ void OutputDevice::CopyArea( const Point& rDestPt, void OutputDevice::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 /*nFlags*/) { - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) - { - aPosAry.mnDestWidth = aPosAry.mnSrcWidth; - aPosAry.mnDestHeight = aPosAry.mnSrcHeight; - mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); - } + if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) + return; + + aPosAry.mnDestWidth = aPosAry.mnSrcWidth; + aPosAry.mnDestHeight = aPosAry.mnSrcHeight; + mpGraphics->CopyBits(aPosAry, NULL, this, NULL); } void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize, diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 857cd1cf..1e6a339 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -422,31 +422,28 @@ bool Window::ImplInitGraphics() const void Window::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags ) { + if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0) + return; - const Rectangle aSrcRect ( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ), - Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) ); - - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) + if (nFlags & COPYAREA_WINDOWINVALIDATE) { - if ( nFlags & COPYAREA_WINDOWINVALIDATE ) - { - ImplMoveAllInvalidateRegions( aSrcRect, - aPosAry.mnDestX-aPosAry.mnSrcX, - aPosAry.mnDestY-aPosAry.mnSrcY, - false ); + const Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY), + Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight)); - mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY, - aPosAry.mnSrcX, aPosAry.mnSrcY, - aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, - SAL_COPYAREA_WINDOWINVALIDATE, this ); - } - else - { - aPosAry.mnDestWidth = aPosAry.mnSrcWidth; - aPosAry.mnDestHeight = aPosAry.mnSrcHeight; - mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); - } + ImplMoveAllInvalidateRegions(aSrcRect, + aPosAry.mnDestX-aPosAry.mnSrcX, + aPosAry.mnDestY-aPosAry.mnSrcY, + false); + + mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY, + aPosAry.mnSrcX, aPosAry.mnSrcY, + aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, + SAL_COPYAREA_WINDOWINVALIDATE, this); + + return; } + + OutputDevice::CopyAreaFinal(aPosAry, nFlags); } void Window::ImplReleaseGraphics( bool bRelease ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits