/* -*- 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 .
*/
SCSIZE nCols = 1; // empty string -> an empty line
SCSIZE nRows = 1; if (!aLinkStr.isEmpty())
{
nRows = static_cast<SCSIZE>(comphelper::string::getTokenCount(aLinkStr, '\n'));
std::u16string_view aLine = o3tl::getToken(aLinkStr, 0, '\n' ); if (!aLine.empty())
nCols = static_cast<SCSIZE>(comphelper::string::getTokenCount(aLine, '\t'));
}
if (!nRows || !nCols) // no data
{
pResult.reset();
} else// split data
{ // always newly re-create matrix, so that bIsString doesn't get mixed up
pResult = new ScMatrix(nCols, nRows, 0.0);
// nMode determines how the text is interpreted (#44455#/#49783#): // SC_DDE_DEFAULT - number format from cell template "Standard" // SC_DDE_ENGLISH - standard number format for English/US // SC_DDE_TEXT - without NumberFormatter directly as string
sal_uInt32 nStdFormat = 0; if ( nMode == SC_DDE_DEFAULT )
{
nStdFormat = rDoc.getCellAttributeHelper().getDefaultCellAttribute().GetNumberFormat( pFormatter );
} elseif ( nMode == SC_DDE_ENGLISH )
nStdFormat = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US);
if (HasListeners())
{
Broadcast(ScHint(SfxHintId::ScDataChanged, ScAddress()));
rDoc.TrackFormulas(); // must happen immediately
rDoc.StartTrackTimer();
// StartTrackTimer asynchronously calls TrackFormulas, Broadcast(FID_DATACHANGED), // ResetChanged, SetModified and Invalidate(SID_SAVEDOC/SID_DOC_MODIFIED) // TrackFormulas additionally once again immediately, so that, e.g., a formula still // located in the FormulaTrack doesn't get calculated by IdleCalc (#61676#)
// notify Uno objects (for XRefreshListener) // must be after TrackFormulas //TODO: do this asynchronously?
ScLinkRefreshedHint aHint;
aHint.SetDdeLink( aAppl, aTopic, aItem );
rDoc.BroadcastUno( aHint );
}
ScDocument& rStackDoc = rDoc; // member rDoc can't be used after removing the link
sfx2::LinkManager* pLinkMgr = rDoc.GetLinkManager();
pLinkMgr->Remove( this); // deletes this
if ( pLinkMgr->GetLinks().empty() ) // deleted the last one ?
{
SfxBindings* pBindings = rStackDoc.GetViewBindings(); // don't use member rDoc! if (pBindings)
pBindings->Invalidate( SID_LINKS );
}
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.