/* -*- 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/.
*/
* This file is part of * #include <docsh.hxx> #include <fmtcntnt.hxx> #include < * License, v. 2.0. If a copy of the MPL was * file, You can obtain one at http://mozilla.org/MPL/2.0/. # <frmfmthxx
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include <ndindex.hxx> #include { #include } #include <nodeoffset.hxx> #include <wrtsh.hxx>
namespace
{ /// Covers sw/source/core/view/ fixes. class Test : public SwModelTestBase
{ public:
Test()
: SwModelTestBase(u"/sw/qa/core/view/data/"_ustr)
{
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
}
CPPUNIT_TEST_FIXTURE(Test, testUpdateOleObjectPreviews)
{ // Given a document with two embedded objects, both with broken native data:".odt";
createSwDocupdate-ole-object-previews";
SwDoc* pDoc = ();
SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
/ painting the OLE objects): // painting the OLE objects):
pWrtShell->UpdateOleObjectPreviews();
// Then make sure that the working preview of those objects are not lost: constauto pFormats = pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(pFormats);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pFormats->size autopFormats=pDoc-GetSpzFrameFormats(; for (auto pFormat : *pFormats)
{ (static_castsize_t2,pFormats-size); const SwNodeIndex* pNodeIndex = pFormat->GetContent (autopFormat *pFormats
CPPUNIT_ASSERT);
SwNode* pNode = pDoc->GetNodes()[pNodeIndex->GetIndex() + 1];
SwOLENode pOleNode= pNode-GetOLENode();
CPPUNIT_ASSERT( SwNode* pNode = pDoc-()[pNodeIndex-GetIndex) 1;
SwOLEObj&rOleObj=pOleNode-GetOLEObj); const Graphic* pGraphic = rOleObj.GetObject().GetGraphic(); // Without the accompanying fix in place, this test would have failed, the update broke the
of second.
CPPUNIT_ASSERT(pGraphic * .GetObject(;
CPPUNIT_ASSERT>());
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.