Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/svx/qa/unit/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 11 kB image not shown  

Quelle  framelinkarray.cxx

  Sprache: C
 

/* -*- 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/.
 */


#include <test/unoapi_test.hxx>

#include <svx/framelinkarray.hxx>
#include <svx/framelink.hxx>

using namespace com::sun::star;

class FrameLinkArrayTest : public UnoApiTest
{
public:
    FrameLinkArrayTest()
        : UnoApiTest(u"svx/qa/unit/data/"_ustr)
    {
    }
};

CPPUNIT_TEST_FIXTURE(FrameLinkArrayTest, testSingleCell)
{
    svx::frame::Array stArr;
    stArr.Initialize(1010);

    stArr.SetCellStyleLeft(/*col*/ 2, /*row*/ 4,
                           svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::ENGRAVED, 1.0 });
    stArr.SetCellStyleRight(/*col*/ 2, /*row*/ 4,
                            svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOTTED, 1.0 });
    stArr.SetCellStyleTop(/*col*/ 2, /*row*/ 4,
                          svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DASHED, 1.0 });
    stArr.SetCellStyleBottom(/*col*/ 2, /*row*/ 4,
                             svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOUBLE1.0 });

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleLeft(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleRight(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(24).Type());
}

CPPUNIT_TEST_FIXTURE(FrameLinkArrayTest, testSingleCellRtl)
{
    svx::frame::Array stArr;
    stArr.Initialize(1010);

    stArr.SetCellStyleLeft(/*col*/ 2, /*row*/ 4,
                           svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::ENGRAVED, 1.0 });
    stArr.SetCellStyleRight(/*col*/ 2, /*row*/ 4,
                            svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOTTED, 1.0 });
    stArr.SetCellStyleTop(/*col*/ 2, /*row*/ 4,
                          svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DASHED, 1.0 });
    stArr.SetCellStyleBottom(/*col*/ 2, /*row*/ 4,
                             svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOUBLE1.0 });

    stArr.MirrorSelfX();

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(24).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleLeft(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleRight(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(74).Type());
}

CPPUNIT_TEST_FIXTURE(FrameLinkArrayTest, testMergedCell)
{
    svx::frame::Array stArr;
    stArr.Initialize(1010);

    stArr.SetCellStyleLeft(/*col*/ 2, /*row*/ 4,
                           svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::ENGRAVED, 1.0 });
    stArr.SetCellStyleRight(/*col*/ 2, /*row*/ 4,
                            svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOTTED, 1.0 });
    stArr.SetCellStyleTop(/*col*/ 2, /*row*/ 4,
                          svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DASHED, 1.0 });
    stArr.SetCellStyleBottom(/*col*/ 2, /*row*/ 4,
                             svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOUBLE1.0 });
    stArr.SetMergedRange(/*first col*/ 2, /*first row*/ 4, /*last col*/ 4, /*last row*/ 6);

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleLeft(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(24).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(24).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(34).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(34).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(34).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(34).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(44).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleRight(44).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(44).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(44).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleLeft(25).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(25).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(25).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(25).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(35).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(35).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(35).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(35).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(45).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleRight(45).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(45).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(45).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleLeft(26).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(26).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(26).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(26).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(36).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(36).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(36).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(36).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(46).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleRight(46).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(46).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(46).Type());
}

CPPUNIT_TEST_FIXTURE(FrameLinkArrayTest, testMergedCellRtl)
{
    svx::frame::Array stArr;
    stArr.Initialize(1010);

    stArr.SetCellStyleLeft(/*col*/ 2, /*row*/ 4,
                           svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::ENGRAVED, 1.0 });
    stArr.SetCellStyleRight(/*col*/ 2, /*row*/ 4,
                            svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOTTED, 1.0 });
    stArr.SetCellStyleTop(/*col*/ 2, /*row*/ 4,
                          svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DASHED, 1.0 });
    stArr.SetCellStyleBottom(/*col*/ 2, /*row*/ 4,
                             svx::frame::Style{ 1.01.01.0, SvxBorderLineStyle::DOUBLE1.0 });
    stArr.SetMergedRange(/*first col*/ 2, /*first row*/ 4, /*last col*/ 4, /*last row*/ 6);
    stArr.MirrorSelfX();

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleLeft(54).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(54).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(54).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(54).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(64).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(64).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(64).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(64).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleRight(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DASHED, stArr.GetCellStyleTop(74).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(74).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleLeft(55).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(55).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(55).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(55).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(65).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(65).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(65).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(65).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(75).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleRight(75).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(75).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleBottom(75).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, stArr.GetCellStyleLeft(56).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(56).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(56).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(56).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(66).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleRight(66).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(66).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(66).Type());

    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleLeft(76).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::ENGRAVED, stArr.GetCellStyleRight(76).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, stArr.GetCellStyleTop(76).Type());
    CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOUBLE, stArr.GetCellStyleBottom(76).Type());
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=93 H=97 G=94

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-06) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.