/* -*- 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 incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
void SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell )
{ // IA2 CWS introduced bInCell, but also did many other changes here. // Need to verify implementation with AT (IA2 and ATK) // Old implementation at the end of the method for reference...
//added dummy attributes for the default text
std::vector<EECharAttrib> aCharAttribs, aTempCharAttribs;
rEE.GetCharAttribs( nPara, aTempCharAttribs );
if (!aTempCharAttribs.empty())
{
sal_Int32 nIndex2 = 0;
sal_Int32 nParaLen = rEE.GetTextLen(nPara); for (size_t nAttr = 0; nAttr < aTempCharAttribs.size(); ++nAttr)
{ if (nIndex2 < aTempCharAttribs[nAttr].nStart)
{
EECharAttrib aEEAttr(nIndex2, aTempCharAttribs[nAttr].nStart);
aCharAttribs.insert(aCharAttribs.begin() + nAttr, aEEAttr);
}
nIndex2 = aTempCharAttribs[nAttr].nEnd;
aCharAttribs.push_back(aTempCharAttribs[nAttr]);
} if ( nIndex2 != nParaLen )
{
EECharAttrib aEEAttr(nIndex2, nParaLen);
aCharAttribs.push_back(aEEAttr);
}
} // find closest index in front of nIndex
sal_Int32 nCurrIndex;
sal_Int32 nClosestStartIndex_s = 0, nClosestStartIndex_e = 0; for (autoconst& charAttrib : aCharAttribs)
{
nCurrIndex = charAttrib.nStart;
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.