[Libreoffice-commits] core.git: test/source

Laurent Godard lgodard.libre at laposte.net
Wed Jul 2 06:02:47 PDT 2014


 test/source/sheet/xsheetannotations.cxx |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit c103775cd15b658bf5db1bda081c1ba5bd653c2a
Author: Laurent Godard <lgodard.libre at laposte.net>
Date:   Fri Jun 27 17:09:15 2014 +0200

    correct XSheetAnnotations GetByIndex test for #fdo#80551
    
    the previous testGetCount test already added a note on sheet 2
    testGetByIndex now works on sheet 3
    
    Change-Id: I2cd49aa2bbf5c1b707287518e0f15088f3ee5ec0
    Reviewed-on: https://gerrit.libreoffice.org/9938
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/test/source/sheet/xsheetannotations.cxx b/test/source/sheet/xsheetannotations.cxx
index 66a7b8d..d6e521f 100644
--- a/test/source/sheet/xsheetannotations.cxx
+++ b/test/source/sheet/xsheetannotations.cxx
@@ -171,31 +171,32 @@ void XSheetAnnotations::testGetByIndex()
     table::CellAddress xThirdCellAddress0 (0,0,3);
     aSheet0Annotations->insertNew(xThirdCellAddress0, "an inserted annotation 3 on sheet 1");
 
-    // insert annotations in second sheet
-    uno::Reference< sheet::XSheetAnnotations > aSheet1Annotations (getAnnotations(1), UNO_QUERY_THROW);
-    table::CellAddress xTargetCellAddress1 (1,4,5);
-    aSheet1Annotations->insertNew(xTargetCellAddress1, "an inserted annotation 1 on sheet 2");
-    table::CellAddress xSecondTargetCellAddress1 (1,5,6);
-    aSheet1Annotations->insertNew(xSecondTargetCellAddress1, "an inserted annotation 2 on sheet 2");
-    table::CellAddress xThirdCellAddress1 (1,7,8);
-    aSheet1Annotations->insertNew(xThirdCellAddress1, "an inserted annotation 3 on sheet 2");
+    // insert annotations in third sheet
+    uno::Reference< sheet::XSheetAnnotations > aSheet2Annotations (getAnnotations(2), UNO_QUERY_THROW);
+    table::CellAddress xTargetCellAddress2 (2,4,5);
+    aSheet2Annotations->insertNew(xTargetCellAddress2, "an inserted annotation 1 on sheet 3");
+    table::CellAddress xSecondTargetCellAddress2 (2,5,6);
+    aSheet2Annotations->insertNew(xSecondTargetCellAddress2, "an inserted annotation 2 on sheet 3");
+    table::CellAddress xThirdCellAddress2 (2,7,8);
+    aSheet2Annotations->insertNew(xThirdCellAddress2, "an inserted annotation 3 on sheet 3");
 
     // get second annotation for second sheet
-    uno::Reference< sheet::XSheetAnnotations > aSheetAnnotations (getAnnotations(1), UNO_QUERY_THROW);
+    uno::Reference< sheet::XSheetAnnotations > aSheetAnnotations (getAnnotations(2), UNO_QUERY_THROW);
     uno::Reference< container::XIndexAccess > xAnnotationsIndex (aSheetAnnotations, UNO_QUERY_THROW);
     uno::Reference< sheet::XSheetAnnotation > aAnnotation (xAnnotationsIndex->getByIndex(1), UNO_QUERY_THROW);
 
     table::CellAddress xToBeAnalyzedCellAddress = aAnnotation->getPosition();
 
+    // is the CellAddress ok ?
     CPPUNIT_ASSERT_EQUAL_MESSAGE(
         "GetByIndex Annotation - Wrong SHEET reference position",
-        xSecondTargetCellAddress1.Sheet, xToBeAnalyzedCellAddress.Sheet);
+        xSecondTargetCellAddress2.Sheet, xToBeAnalyzedCellAddress.Sheet);
     CPPUNIT_ASSERT_EQUAL_MESSAGE(
         "GetByIndex Annotation - Wrong COLUMN reference position",
-        xSecondTargetCellAddress1.Column, xToBeAnalyzedCellAddress.Column);
+        xSecondTargetCellAddress2.Column, xToBeAnalyzedCellAddress.Column);
     CPPUNIT_ASSERT_EQUAL_MESSAGE(
         "GetByIndex Annotation - Wrong ROW reference position",
-        xSecondTargetCellAddress1.Row, xToBeAnalyzedCellAddress.Row);
+        xSecondTargetCellAddress2.Row, xToBeAnalyzedCellAddress.Row);
 
     // is the string ok ?
     uno::Reference< text::XTextRange > aTextSheetAnnotation(aAnnotation, UNO_QUERY_THROW);
@@ -203,8 +204,7 @@ void XSheetAnnotations::testGetByIndex()
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE(
         "GetByIndex Annotation - Wrong string",
-        OUString("an inserted annotation 2 on sheet 2"), aString);
-
+        OUString("an inserted annotation 2 on sheet 3"), aString);
 }
 
 }


More information about the Libreoffice-commits mailing list