[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e0be9a035a82131628ad07ae05be8bf322730f66 Author: Tor Lillqvist t...@iki.fi Date: Sun Apr 22 20:11:30 2012 +0300 WaE: variable 'stackptr' is uninitialized when used diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx index c9fd510..8f397d9 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx @@ -80,7 +80,7 @@ void callVirtualMethod( if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything(xxx); // address something volatile long edx = 0, eax = 0; // for register returns -void * stackptr; +void * stackptr = 0; asm volatile ( mov %%esp, %6\n\t mov %0, %%eax\n\t ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: shell/source
shell/source/backends/macbe/macbackend.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7bec04312dcef51c8f7b248231e139178fdeada1 Author: Tor Lillqvist t...@iki.fi Date: Sun Apr 22 21:44:29 2012 +0300 WaE: initialization of pointer to null from a constant boolean expression diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx index 055628f..aaf7ebf 100644 --- a/shell/source/backends/macbe/macbackend.cxx +++ b/shell/source/backends/macbe/macbackend.cxx @@ -406,7 +406,7 @@ css::uno::Any MacOSXBackend::getPropertyValue( CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL); if (!rProxyDict) -rExceptionsList = false; +rExceptionsList = 0; else rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sc/inc sc/source
sc/inc/tokenarray.hxx |3 ++- sc/source/core/data/cell.cxx |7 --- sc/source/core/tool/token.cxx | 14 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) New commits: commit bba176a844bd993cf7fe6acce9ff18027870dfa5 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Apr 23 01:15:01 2012 +0200 only update absolute refs when copying between docs, fdo#48482 The copy/paste formulas code is getting a bit complex. I will try to write some test cases for it. diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx index 48bf4c5..cc55936 100644 --- a/sc/inc/tokenarray.hxx +++ b/sc/inc/tokenarray.hxx @@ -108,8 +108,9 @@ public: /** * Make all absolute references pointing to the copied range if the range is copied too + * @param bCheckCopyArea should references pointing into the copy area be adjusted independently from being absolute, should be true only for copypaste between documents */ -void AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName = false ); +void AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName = false, bool bCheckCopyArea = false ); }; #endif // SC_TOKENARRAY_HXX diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index a4e5361..fd9499b 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -175,7 +175,7 @@ void adjustRangeName(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOl if (rNewDoc.GetPool() != const_castScDocument*(pOldDoc)-GetPool()) { pRangeNameToken-ReadjustAbsolute3DReferences(pOldDoc, rNewDoc, pRangeData-GetPos(), true); -pRangeNameToken-AdjustAbsoluteRefs(pOldDoc, aOldPos, aNewPos, true); +pRangeNameToken-AdjustAbsoluteRefs(pOldDoc, aOldPos, aNewPos, false, true); } bool bInserted; @@ -811,12 +811,13 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, ScDocument rDoc, cons } } -if (pDocument-GetPool() != rCell.pDocument-GetPool()) +bool bCopyBetweenDocs = pDocument-GetPool() != rCell.pDocument-GetPool(); +if (bCopyBetweenDocs) { pCode-ReadjustAbsolute3DReferences( rCell.pDocument, rDoc, rCell.aPos); } -pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos ); +pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos, false, bCopyBetweenDocs ); } if ( nCloneFlags SC_CLONECELL_ADJUST3DREL ) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0bbb3d6..dc88df1 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1832,7 +1832,7 @@ bool IsInCopyRange( const ScRange rRange, const ScDocument* pClipDoc ) return rClipParam.maRanges.In(rRange); } -bool SkipReference(ScToken* pToken, const ScAddress rPos, const ScDocument* pOldDoc, bool bRangeName) +bool SkipReference(ScToken* pToken, const ScAddress rPos, const ScDocument* pOldDoc, bool bRangeName, bool bCheckCopyArea) { ScRange aRange; @@ -1862,7 +1862,7 @@ bool SkipReference(ScToken* pToken, const ScAddress rPos, const ScDocument* pOl } } -if (IsInCopyRange(aRange, pOldDoc)) +if (bCheckCopyArea IsInCopyRange(aRange, pOldDoc)) return true; return false; @@ -1894,7 +1894,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons { case svDoubleRef : { -if (SkipReference(static_castScToken*(pCode[j]), rPos, pOldDoc, bRangeName)) +if (SkipReference(static_castScToken*(pCode[j]), rPos, pOldDoc, bRangeName, true)) continue; ScComplexRefData rRef = static_castScToken*(pCode[j])-GetDoubleRef(); @@ -1915,7 +1915,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons break; case svSingleRef : { -if (SkipReference(static_castScToken*(pCode[j]), rPos, pOldDoc, bRangeName)) +if (SkipReference(static_castScToken*(pCode[j]), rPos, pOldDoc, bRangeName, true)) continue; ScSingleRefData rRef = static_castScToken*(pCode[j])-GetSingleRef(); @@ -1941,7 +1941,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons } } -void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName) +void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName, bool bCheckCopyRange) { for ( sal_uInt16 j=0; jnLen; ++j ) { @@ -1949,7 +1949,7 @@ void ScTokenArray::AdjustAbsoluteRefs( const ScDocument*
[Libreoffice-commits] .: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) New commits: commit 7d65dd728ca2b7dea073ef085110dccdf22c2d5c Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Apr 23 02:18:14 2012 +0200 add test case for copy/paste formulas, related fdo#48482 diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 07782da..9542320 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -209,6 +209,7 @@ public: void testRenameTable(); void testAutoFill(); +void testCopyPasteFormulas(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); @@ -249,6 +250,7 @@ public: CPPUNIT_TEST(testSetBackgroundColor); CPPUNIT_TEST(testRenameTable); CPPUNIT_TEST(testAutoFill); +CPPUNIT_TEST(testCopyPasteFormulas); CPPUNIT_TEST_SUITE_END(); private: @@ -4221,6 +4223,25 @@ void Test::testAutoFill() m_pDoc-DeleteTab(0); } +void Test::testCopyPasteFormulas() +{ +m_pDoc-InsertTab(0, Sheet1); +m_pDoc-InsertTab(1, Sheet2); + +m_pDoc-SetString(0,0,0, =COLUMN($A$1)); +m_pDoc-SetInTest(); +CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(0,0,0), 1.0, 1e-08); +ScDocFunc rDocFunc = m_xDocShRef-GetDocFunc(); +bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0), ScAddress( 10, 10, 0), false, false, false, true); + +// check that moving was succesful, mainly for editable tester +CPPUNIT_ASSERT(bMoveDone); +CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(10,10,0), 1.0, 1e-8); +rtl::OUString aFormula; +m_pDoc-GetFormula(10,10,0, aFormula); +CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=COLUMN($A$1))); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } commit 0d3d836ec6541b7a1e0a7fa48195ebb678e2951e Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Mon Apr 23 01:34:47 2012 +0200 I did not want to disable these tests diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index c743e68..07782da 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -211,7 +211,6 @@ public: void testAutoFill(); CPPUNIT_TEST_SUITE(Test); -#if 0 CPPUNIT_TEST(testCollator); CPPUNIT_TEST(testInput); CPPUNIT_TEST(testCellFunctions); @@ -249,7 +248,6 @@ public: CPPUNIT_TEST(testJumpToPrecedentsDependents); CPPUNIT_TEST(testSetBackgroundColor); CPPUNIT_TEST(testRenameTable); -#endif CPPUNIT_TEST(testAutoFill); CPPUNIT_TEST_SUITE_END(); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5-3' - 5 commits - sax/qa sax/source writerfilter/source xmloff/source
sax/qa/cppunit/test_converter.cxx | 72 +++ sax/source/tools/converter.cxx | 155 +++-- writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 xmloff/source/core/xmluconv.cxx|2 4 files changed, 218 insertions(+), 13 deletions(-) New commits: commit 70ba1b80ced76c40ad5d43101db9a1f60a00011c Author: Fridrich Å trba fridrich.st...@bluewin.ch Date: Fri Apr 20 22:30:26 2012 +0200 Minor backporting fix Signed-off-by: Michael Stahl mst...@redhat.com Signed-off-by: Miklos Vajna vmik...@suse.cz Signed-off-by: David Tardon dtar...@redhat.com diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index a8dad87..023177f 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -266,7 +266,7 @@ void doTestDouble(char const*const pis, double const rd, Converter::convertDouble(buf, od, true, nTargetUnit, nSourceUnit); OSL_TRACE(%s, ::rtl::OUStringToOString(buf.getStr(), RTL_TEXTENCODING_UTF8).getStr()); -CPPUNIT_ASSERT_EQUAL(is, buf.makeStringAndClear()); +CPPUNIT_ASSERT(buf.makeStringAndClear().equals(is)); } void ConverterTest::testDouble() commit 30878ae72d0881e9e3990bc6911a7e5ee4b64cd6 Author: Michael Stahl mst...@redhat.com Date: Fri Apr 20 18:39:36 2012 +0200 fdo#48969: add unit test for Converter::convertDouble Signed-off-by: Fridrich Å trba fridrich.st...@bluewin.ch Signed-off-by: Miklos Vajna vmik...@suse.cz Signed-off-by: David Tardon dtar...@redhat.com diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index 4a3d364..a8dad87 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -39,11 +39,13 @@ #include com/sun/star/util/DateTime.hpp #include com/sun/star/util/Date.hpp #include com/sun/star/util/Duration.hpp +#include com/sun/star/util/MeasureUnit.hpp #include sax/tools/converter.hxx using namespace ::com::sun::star; +using namespace ::com::sun::star::util::MeasureUnit; using sax::Converter; @@ -58,10 +60,12 @@ public: void testDuration(); void testDateTime(); +void testDouble(); CPPUNIT_TEST_SUITE(ConverterTest); CPPUNIT_TEST(testDuration); CPPUNIT_TEST(testDateTime); +CPPUNIT_TEST(testDouble); CPPUNIT_TEST_SUITE_END(); private: @@ -249,6 +253,74 @@ void ConverterTest::testDateTime() OSL_TRACE(\nSAX CONVERTER TEST END); } +void doTestDouble(char const*const pis, double const rd, +sal_Int16 const nSourceUnit, sal_Int16 const nTargetUnit) +{ +::rtl::OUString const is(::rtl::OUString::createFromAscii(pis)); +double od; +bool bSuccess(Converter::convertDouble(od, is, nSourceUnit, nTargetUnit)); +OSL_TRACE(%f, od); +CPPUNIT_ASSERT(bSuccess); +CPPUNIT_ASSERT_DOUBLES_EQUAL(rd, od, 0.0001); +::rtl::OUStringBuffer buf; +Converter::convertDouble(buf, od, true, nTargetUnit, nSourceUnit); +OSL_TRACE(%s, +::rtl::OUStringToOString(buf.getStr(), RTL_TEXTENCODING_UTF8).getStr()); +CPPUNIT_ASSERT_EQUAL(is, buf.makeStringAndClear()); +} + +void ConverterTest::testDouble() +{ +doTestDouble(42, 42.0, TWIP, TWIP); +doTestDouble(42, 42.0, POINT, POINT); +doTestDouble(42, 42.0, MM_100TH, MM_100TH); +doTestDouble(42, 42.0, MM_10TH, MM_10TH); +doTestDouble(42, 42.0, MM, MM); // identity don't seem to add unit? +doTestDouble(42, 42.0, CM, CM); +doTestDouble(42, 42.0, INCH, INCH); +doTestDouble(2pt, 40.0, POINT, TWIP); +doTestDouble(20pc, 1, TWIP, POINT); +doTestDouble(4, 2.26771653543307, MM_100TH, TWIP); +doTestDouble(4, 22.6771653543307, MM_10TH, TWIP); +doTestDouble(4mm, 226.771653543307, MM, TWIP); +doTestDouble(4cm, 2267.71653543307, CM, TWIP); +doTestDouble(4in, 5760.0, INCH, TWIP); +doTestDouble(1440pc, 1.0, TWIP, INCH); +doTestDouble(567pc, 1.000125, TWIP, CM); +doTestDouble(56.7pc, 1.000125, TWIP, MM); +doTestDouble(5.67pc, 1.000125, TWIP, MM_10TH); +doTestDouble(0.567pc, 1.000125, TWIP, MM_100TH); +doTestDouble(42pt, 1.48166, POINT, CM); +doTestDouble(42pt, 14.8166, POINT, MM); +doTestDouble(42pt, 148.166, POINT, MM_10TH); +doTestDouble(42pt, 1481.66, POINT, MM_100TH); +doTestDouble(72pt, 1.0, POINT, INCH); +doTestDouble(3.5in, 8.89, INCH, CM); +doTestDouble(3.5in, 88.9, INCH, MM); +doTestDouble(3.5in, 889.0, INCH, MM_10TH); +doTestDouble(3.5in, 8890.0, INCH, MM_100TH); +doTestDouble(2in, 144, INCH, POINT); +doTestDouble(5.08cm, 2.0, CM, INCH); +doTestDouble(3.5cm, 3500.0, CM, MM_100TH); +doTestDouble(3.5cm, 350.0, CM, MM_10TH); +doTestDouble(3.5cm, 35.0, CM, MM); +doTestDouble(10cm, 283.464566929134, CM, POINT); +doTestDouble(0.5cm, 283.464566929134, CM, TWIP); +doTestDouble(10mm, 28.3464566929134, MM, POINT); +
[Libreoffice-commits] .: 3 commits - sc/inc sc/source unusedcode.easy vcl/inc vcl/source
sc/inc/dbdata.hxx |1 sc/source/core/tool/dbdata.cxx |5 unusedcode.easy |7 -- vcl/inc/salgdi.hxx |4 --- vcl/inc/vcl/outdev.hxx |4 --- vcl/source/gdi/outmap.cxx | 42 vcl/source/gdi/salgdilayout.cxx | 34 7 files changed, 97 deletions(-) New commits: commit d31aae4c9eea4f4aecea2a051518536b47aa8ab6 Author: Monica Ramirez Arceda mon...@probeta.net Date: Mon Apr 23 11:30:01 2012 +0530 Remove unused vcl methods. diff --git a/unusedcode.easy b/unusedcode.easy index b2ca35e..b09221f 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -27,10 +27,6 @@ Matrix3d::Inverse() const Matrix3d::Matrix3d() PopupMenu::SetSelectedEntry(unsigned short) PropBrwMgr::GetChildWindowId() -SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const, unsigned int, OutputDevice const*) -SalGraphics::drawAlphaBitmap(SalTwoRect const, SalBitmap const, SalBitmap const) -SalGraphics::drawPolyLine(basegfx::B2DPolygon const, double, basegfx::B2DVector const, basegfx::B2DLineJoin) -SalGraphics::drawPolyPolygon(basegfx::B2DPolyPolygon const, double) SanExtensionImpl::setCertExtn(com::sun::star::uno::Sequencesigned char, com::sun::star::uno::Sequencesigned char, unsigned char) SanExtensionImpl::setCertExtn(unsigned char*, unsigned int, unsigned char*, unsigned int, unsigned char) ScAddInAsyncs::Insert(ScAddInAsync* const, unsigned short) diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index e351ed3..6c99e46 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -405,10 +405,6 @@ public: const OutputDevice *pOutDev ); voidDrawBitmap( const SalTwoRect* pPosAry, const SalBitmap rSalBitmap, -SalColor nTransparentColor, -const OutputDevice *pOutDev ); -voidDrawBitmap( const SalTwoRect* pPosAry, -const SalBitmap rSalBitmap, const SalBitmap rTransparentBitmap, const OutputDevice *pOutDev ); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 2197905..d750264 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -91,14 +91,6 @@ SalGraphics::~SalGraphics() // -bool SalGraphics::drawAlphaBitmap( const SalTwoRect, -const SalBitmap, const SalBitmap ) -{ -return false; -} - -// - void SalGraphics::mirror( long x, const OutputDevice *pOutDev, bool bBack ) const { long w; @@ -411,14 +403,6 @@ voidSalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, cons mirror( nX, nWidth, pOutDev ); drawRect( nX, nY, nWidth, nHeight ); } -bool SalGraphics::drawPolyLine( -const basegfx::B2DPolygon /*rPolyPolygon*/, -double /*fTransparency*/, -const basegfx::B2DVector /*rLineWidths*/, -basegfx::B2DLineJoin /*eLineJoin*/) -{ -return false; -} void SalGraphics::DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev ) { @@ -483,11 +467,6 @@ bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon i_rPolyPolyg return bRet; } -bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon, double /*fTransparency*/) -{ -return false; -} - sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev ) { sal_Bool bResult = sal_False; @@ -600,19 +579,6 @@ voidSalGraphics::DrawBitmap( const SalTwoRect* pPosAry, else drawBitmap( pPosAry, rSalBitmap ); } -voidSalGraphics::DrawBitmap( const SalTwoRect* pPosAry, -const SalBitmap rSalBitmap, -SalColor nTransparentColor, const OutputDevice *pOutDev ) -{ -if( (m_nLayout SAL_LAYOUT_BIDI_RTL) || (pOutDev pOutDev-IsRTLEnabled()) ) -{ -SalTwoRect pPosAry2 = *pPosAry; -mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev ); -drawBitmap( pPosAry2, rSalBitmap, nTransparentColor ); -} -else -drawBitmap( pPosAry, rSalBitmap, nTransparentColor ); -} void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap rSalBitmap, const SalBitmap rTransparentBitmap, const OutputDevice *pOutDev ) commit 2910933f2609b19d9c6c4b793288e1b2d9991080 Author: Santiago Martinez smvar...@gmail.com Date: Mon Apr 23 11:27:07 2012 +0530 Remove unused code in vcl diff --git