/* -*- 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/.
*/
auto it = aView2.m_aStateChanges.find(".uno:Sidebar");
CPPUNIT_ASSERT(it != aView2.m_aStateChanges.end());
std::string aLocale = it->second.get<std::string>("locale");
CPPUNIT_ASSERT_EQUAL(std::string("de-DE"), aLocale);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCopyMultiSelection)
{ // Given a document with A1 and A3 as selected cells:
ScModelObj* pModelObj = createDoc("multi-selection.ods");
ScTestViewCallback aView1; // Get the center of A3:
uno::Sequence<beans::PropertyValue> aPropertyValues = {
comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$3"_ustr),
};
dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues);
Point aPoint = aView1.m_aCellCursorBounds.Center(); // Go to A1:
aPropertyValues = {
comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$1"_ustr),
};
dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues); // Ctrl-click on A3: int nCtrl = KEY_MOD1;
pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aPoint.getX(), aPoint.getY(), 1,
MOUSE_LEFT, nCtrl);
// When getting the selection:
uno::Reference<datatransfer::XTransferable> xTransferable = pModelObj->getSelection();
// Make sure we get A1+A3 instead of an error:
CPPUNIT_ASSERT(xTransferable.is());
// Also make sure that just 2 cells is classified as a simple selection:
uno::Reference<datatransfer::XTransferable2> xTransferable2(xTransferable, uno::UNO_QUERY);
CPPUNIT_ASSERT(xTransferable2.is()); // Without the fix, the text selection was complex.
CPPUNIT_ASSERT(!xTransferable2->isComplex());
}
// Without the fix, it fails with // - Expected: 2 // - Actual : 8 // where 2 is FieldUnit::CM and 8 is FieldUnit::INCH
CPPUNIT_ASSERT_EQUAL(FieldUnit::CM, eMetric);
}
// Without the fix in place, this test would have failed with // - Expected: 0 // - Actual : 2
assertXPathContent(pSettings, "/office:document-settings/office:settings/config:config-item-set[1]/" "config:config-item-map-indexed/config:config-item-map-entry/" "config:config-item-map-named/config:config-item-map-entry/" "config:config-item[@config:name='VerticalSplitMode']",
u"0");
}
// Without the fix in place, this test would have failed with // - Expected: topRight // - Actual : bottomRight // which also results in invalid XLSX
assertXPath(pSheet, "/x:worksheet/x:sheetViews/x:sheetView/x:pane", "activePane", u"topRight");
}
// Check that we have the comment on A1
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
ScPostIt* pNote = pDoc->GetNote(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pNote->GetText());
// Check that FormatPaintbrush worked
vcl::Font aFont;
pDoc->GetPattern(0, 0, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold A1", WEIGHT_BOLD,
aFont.GetWeightMaybeAskConfig());
// Check that we still have the comment on A1 after FormatPaintbrush
pNote = pDoc->GetNote(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pNote->GetText());
// Check that we still have the comment on A1 after Undo
pNote = pDoc->GetNote(ScAddress(0, 0, 0));
CPPUNIT_ASSERT(pNote); // Without the fix in place, this test would have failed with // - Expected : test1 // - Actual :
CPPUNIT_ASSERT_EQUAL(u"test1"_ustr, pNote->GetText());
}
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.