/* -*- 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 .
*/
namespace
{ /** unary function that escapes backslashes and single quotes in a sal_Unicode array (which you can get from an OUString with getStr()) and puts the result into the OUStringBuffer given in the CTOR
*/ class lcl_Escape
{ public: explicit lcl_Escape( OUStringBuffer & aResultBuffer ) : m_aResultBuffer( aResultBuffer ) {} voidoperator() ( sal_Unicode aChar )
{ staticconst sal_Unicode s_aQuote( '\'' ); staticconst sal_Unicode s_aBackslash( '\\' );
/** unary function that removes backslash escapes in a sal_Unicode array (which you can get from an OUString with getStr()) and puts the result into the OUStringBuffer given in the CTOR
*/ class lcl_UnEscape
{ public: explicit lcl_UnEscape( OUStringBuffer & aResultBuffer ) : m_aResultBuffer( aResultBuffer ) {} voidoperator() ( sal_Unicode aChar )
{ staticconst sal_Unicode s_aBackslash( '\\' );
// parse number for row while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 )
i--;
rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1; // a dollar in XML means absolute (whereas in UI it means relative) if( pStrArray[ i ] == aDollar )
{
i--;
rOutCell.bRelativeRow = false;
} else
rOutCell.bRelativeRow = true;
// parse rest for column
assert(i <= 13);
sal_Int64 nPower = 1;
sal_Int64 nColumn = 0; while( i >= 0 && rtl::isAsciiAlpha( pStrArray[ i ] ))
{
nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * nPower;
i--;
nPower *= 26;
} if (nColumn < SAL_MIN_INT32 || nColumn > SAL_MAX_INT32)
{
SAL_WARN("chart2", "out of range column");
nColumn = 0;
}
// iterate over different ranges for( sal_Int32 nStartPos = 0, nEndPos = nStartPos;
nEndPos < nLength;
nStartPos = ++nEndPos )
{ // find start point of next range
if( ! rRange.aLowerRight.empty())
{ // we have a range (not a single cell)
aBuffer.append( u':');
lcl_getXMLStringForCell( rRange.aLowerRight, &aBuffer );
}
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.