Files
libreoffice/sc/source/core/data/documen8.cxx

1621 lines
56 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 23:16:46 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 23:16:46 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 23:16:46 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 23:16:46 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 23:16:46 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 23:16:46 +00:00
*
************************************************************************/
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
2000-09-18 23:16:46 +00:00
#include <tools/string.hxx>
#include <tools/urlobj.hxx>
#include <editeng/editobj.hxx>
#include <editeng/editstat.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/langitem.hxx>
2010-01-13 22:25:07 +01:00
#include <sfx2/linkmgr.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/unolingu.hxx>
CWS-TOOLING: integrate CWS calc50 2009-05-28 12:32:46 +0200 nn r272399 : gcc warning 2009-05-28 10:56:48 +0200 nn r272382 : CWS-TOOLING: rebase CWS calc50 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 14:24:52 +0200 nn r272343 : #i50825# DataPilotUpdate: prevent overwriting source data above the table 2009-05-26 18:29:21 +0200 nn r272316 : #i50019# allow borders for multiple cell ranges 2009-05-26 13:43:36 +0200 nn r272300 : #i101960# UpdateExternalRefLinks: set document modified 2009-05-25 18:01:23 +0200 nn r272267 : #i102056# copied from CWS calc311fixes 2009-05-20 12:24:22 +0200 nn r272114 : #i59672# ExecFilter/SC_AUTOFILTER_CUSTOM: select database range (patch from gaozm) 2009-05-15 18:24:44 +0200 nn r271961 : #i100544# correct ScTokenConversion::ConvertToTokenArray 2009-05-13 17:45:02 +0200 nn r271866 : #i101869# DeleteRange: before broadcasting, check if EndListening removed the note cells 2009-05-13 12:43:31 +0200 nn r271856 : #i101806# correct reference undo for inserting/deleting columns/rows across sheets 2009-05-11 18:44:46 +0200 nn r271783 : #i101725# don't copy hash_set with pointers from the other collection 2009-05-11 17:54:21 +0200 nn r271780 : #i101690# correct merge error in frmdlg integration 2009-05-07 15:28:55 +0200 nn r271674 : #i96940# check for negative count in fillAuto 2009-05-07 13:47:58 +0200 nn r271661 : #i101512# SetCompileForFAP is in formula::FormulaCompiler 2009-05-07 13:47:27 +0200 nn r271660 : #i101512# use SetCompileForFAP for CompileTokenArray 2009-05-05 18:47:03 +0200 nn r271551 : #i73074# RepeatDB: re-evaluate advanced filter source range 2009-05-05 18:23:21 +0200 nn r271546 : #i97857# use GetInputString for direct reference as validity range source 2009-05-05 17:38:23 +0200 nn r271538 : #i95834# better enable/disable handling of next/previous buttons (patch by cmc)
2009-06-15 10:46:14 +00:00
#include <sfx2/bindings.hxx>
2000-09-18 23:16:46 +00:00
#include <sfx2/objsh.hxx>
#include <sfx2/printer.hxx>
2000-09-22 17:57:10 +00:00
#include <sfx2/viewfrm.hxx>
2000-09-18 23:16:46 +00:00
#include <sfx2/viewsh.hxx>
#include <svl/flagitem.hxx>
#include <svl/intitem.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <unotools/misccfg.hxx>
#include <sfx2/app.hxx>
2001-03-26 18:26:30 +00:00
#include <unotools/transliterationwrapper.hxx>
#include <unotools/securityoptions.hxx>
2000-09-18 23:16:46 +00:00
#include <vcl/virdev.hxx>
2000-09-18 23:16:46 +00:00
#include <vcl/msgbox.hxx>
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include "inputopt.hxx"
2000-09-18 23:16:46 +00:00
#include "global.hxx"
#include "table.hxx"
#include "column.hxx"
#include "cell.hxx"
#include "poolhelp.hxx"
2000-09-18 23:16:46 +00:00
#include "docpool.hxx"
#include "stlpool.hxx"
#include "stlsheet.hxx"
#include "docoptio.hxx"
#include "viewopti.hxx"
#include "scextopt.hxx"
#include "rechead.hxx"
#include "ddelink.hxx"
#include "scmatrix.hxx"
2000-09-18 23:16:46 +00:00
#include "arealink.hxx"
#include "dociter.hxx"
#include "patattr.hxx"
#include "hints.hxx"
#include "editutil.hxx"
#include "progress.hxx"
#include "document.hxx"
#include "chartlis.hxx"
#include "chartlock.hxx"
2000-10-30 10:33:41 +00:00
#include "refupdat.hxx"
2000-09-18 23:16:46 +00:00
#include "validat.hxx" // fuer HasMacroCalls
2001-03-26 18:26:30 +00:00
#include "markdata.hxx"
#include "scmod.hxx"
#include "printopt.hxx"
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
#include "externalrefmgr.hxx"
2000-09-18 23:16:46 +00:00
#include "globstr.hrc"
#include "sc.hrc"
2008-11-26 15:19:48 +00:00
#include "charthelper.hxx"
#include "macromgr.hxx"
#include "dpobject.hxx"
#include "docuno.hxx"
#include "scresid.hxx"
2000-09-18 23:16:46 +00:00
#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue()
// states for online spelling in the visible range (0 is set initially)
#define VSPL_START 0
#define VSPL_DONE 1
// STATIC DATA -----------------------------------------------------------
//------------------------------------------------------------------------
void ScDocument::ImplCreateOptions()
{
pDocOptions = new ScDocOptions();
pViewOptions = new ScViewOptions();
}
//------------------------------------------------------------------------
void ScDocument::ImplDeleteOptions()
{
delete pDocOptions;
delete pViewOptions;
delete pExtDocOptions;
}
//------------------------------------------------------------------------
2011-11-05 07:00:32 +01:00
SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
2000-09-18 23:16:46 +00:00
{
if ( !pPrinter && bCreateIfNotExist )
2000-09-18 23:16:46 +00:00
{
SfxItemSet* pSet =
new SfxItemSet( *xPoolHelper->GetDocPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
2000-09-18 23:16:46 +00:00
NULL );
::utl::MiscCfg aMisc;
sal_uInt16 nFlags = 0;
if ( aMisc.IsPaperOrientationWarning() )
nFlags |= SFX_PRINTER_CHG_ORIENTATION;
if ( aMisc.IsPaperSizeWarning() )
nFlags |= SFX_PRINTER_CHG_SIZE;
pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) );
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
2000-09-18 23:16:46 +00:00
pPrinter = new SfxPrinter( pSet );
pPrinter->SetMapMode( MAP_100TH_MM );
2000-09-18 23:16:46 +00:00
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
2000-09-18 23:16:46 +00:00
}
return pPrinter;
}
//------------------------------------------------------------------------
void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
{
if ( pNewPrinter == pPrinter )
{
// #i6706# SetPrinter is called with the same printer again if
// the JobSetup has changed. In that case just call UpdateDrawPrinter
// (SetRefDevice for drawing layer) because of changed text sizes.
UpdateDrawPrinter();
}
else
{
SfxPrinter* pOld = pPrinter;
pPrinter = pNewPrinter;
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
delete pOld;
}
InvalidateTextWidth(NULL, NULL, false); // in both cases
2000-09-18 23:16:46 +00:00
}
//------------------------------------------------------------------------
void ScDocument::SetPrintOptions()
{
if ( !pPrinter ) GetPrinter(); // setzt pPrinter
OSL_ENSURE( pPrinter, "Error in printer creation :-/" );
2000-09-18 23:16:46 +00:00
if ( pPrinter )
{
::utl::MiscCfg aMisc;
SfxItemSet aOptSet( pPrinter->GetOptions() );
sal_uInt16 nFlags = 0;
if ( aMisc.IsPaperOrientationWarning() )
nFlags |= SFX_PRINTER_CHG_ORIENTATION;
if ( aMisc.IsPaperSizeWarning() )
nFlags |= SFX_PRINTER_CHG_SIZE;
aOptSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) );
aOptSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
pPrinter->SetOptions( aOptSet );
2000-09-18 23:16:46 +00:00
}
}
//------------------------------------------------------------------------
VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
{
if (!pVirtualDevice_100th_mm)
{
pVirtualDevice_100th_mm = new VirtualDevice( 1 );
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
aMapMode.SetMapUnit( MAP_100TH_MM );
pVirtualDevice_100th_mm->SetMapMode( aMapMode );
}
return pVirtualDevice_100th_mm;
}
OutputDevice* ScDocument::GetRefDevice()
{
// Create printer like ref device, see Writer...
OutputDevice* pRefDevice = NULL;
if ( SC_MOD()->GetInputOptions().GetTextWysiwyg() )
pRefDevice = GetPrinter();
else
pRefDevice = GetVirtualDevice_100th_mm();
return pRefDevice;
}
//------------------------------------------------------------------------
2000-09-18 23:16:46 +00:00
void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
const SfxItemSet& rChanges )
{
SfxItemSet& rSet = rStyleSheet.GetItemSet();
switch ( rStyleSheet.GetFamily() )
{
case SFX_STYLE_FAMILY_PAGE:
{
const sal_uInt16 nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
const sal_uInt16 nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
2000-09-18 23:16:46 +00:00
rSet.Put( rChanges );
const sal_uInt16 nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
2000-09-18 23:16:46 +00:00
if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) )
InvalidateTextWidth( rStyleSheet.GetName() );
2008-11-26 15:19:48 +00:00
if( SvtLanguageOptions().IsCTLFontEnabled() )
{
const SfxPoolItem *pItem = NULL;
2011-11-05 07:00:32 +01:00
if( rChanges.GetItemState(ATTR_WRITINGDIR, true, &pItem ) == SFX_ITEM_SET )
2008-11-26 15:19:48 +00:00
ScChartHelper::DoUpdateAllCharts( this );
}
2000-09-18 23:16:46 +00:00
}
break;
case SFX_STYLE_FAMILY_PARA:
{
2011-11-05 07:00:32 +01:00
bool bNumFormatChanged;
2000-09-18 23:16:46 +00:00
if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
rSet, rChanges ) )
InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
2009-09-07 15:38:19 +00:00
for (SCTAB nTab=0; nTab<=MAXTAB; ++nTab)
if (maTabs[nTab] && maTabs[nTab]->IsStreamValid())
maTabs[nTab]->SetStreamValid( false );
CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
2009-09-07 15:38:19 +00:00
sal_uLong nOldFormat =
2000-09-18 23:16:46 +00:00
((const SfxUInt32Item*)&rSet.Get(
ATTR_VALUE_FORMAT ))->GetValue();
sal_uLong nNewFormat =
2000-09-18 23:16:46 +00:00
((const SfxUInt32Item*)&rChanges.Get(
ATTR_VALUE_FORMAT ))->GetValue();
LanguageType eNewLang, eOldLang;
eNewLang = eOldLang = LANGUAGE_DONTKNOW;
if ( nNewFormat != nOldFormat )
{
SvNumberFormatter* pFormatter = GetFormatTable();
eOldLang = pFormatter->GetEntry( nOldFormat )->GetLanguage();
eNewLang = pFormatter->GetEntry( nNewFormat )->GetLanguage();
}
// Bedeutung der Items in rChanges:
// Item gesetzt - Aenderung uebernehmen
// Dontcare - Default setzen
// Default - keine Aenderung
// ("keine Aenderung" geht nicht mit PutExtended, darum Schleife)
for (sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++)
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pItem;
SfxItemState eState = rChanges.GetItemState( nWhich, false, &pItem );
2000-09-18 23:16:46 +00:00
if ( eState == SFX_ITEM_SET )
rSet.Put( *pItem );
else if ( eState == SFX_ITEM_DONTCARE )
rSet.ClearItem( nWhich );
// bei Default nichts
}
if ( eNewLang != eOldLang )
rSet.Put(
SvxLanguageItem( eNewLang, ATTR_LANGUAGE_FORMAT ) );
}
break;
default:
{
// added to avoid warnings
}
2000-09-18 23:16:46 +00:00
}
}
//------------------------------------------------------------------------
void ScDocument::CopyStdStylesFrom( ScDocument* pSrcDoc )
{
2011-02-27 23:59:21 +01:00
// number format exchange list has to be handled here, too
CWS-TOOLING: integrate CWS koheimultirangecopy 2009-08-29 08:19:57 +0200 kohei r275558 : A bit of cleanup & comments. 2009-08-29 08:10:31 +0200 kohei r275557 : removed duplicated code block. 2009-08-29 07:30:33 +0200 kohei r275556 : #i104551# fixed it. 2009-08-28 17:23:28 +0200 kohei r275541 : #i104553# fixed a crash on pasting over existing data. This also fixes notes being destroyed as originally reported in the IZ entry. 2009-08-27 23:36:17 +0200 kohei r275510 : #i104550# fixed. All I had to do was to call MarkToSimple() before examining the geometry of the marked ranges. 2009-08-27 18:04:11 +0200 kohei r275501 : CWS-TOOLING: rebase CWS koheimultirangecopy to trunk@275331 (milestone: DEV300:m56) 2009-08-21 11:37:20 +0200 dr r275228 : #i10000# another wntmsci12 warning 2009-08-21 09:33:32 +0200 dr r275218 : #i10000# sunncc warnings 2009-08-20 20:01:15 +0200 kohei r275196 : Let's not initialize a variable with itself, which is not yet initialized. This was obviously a silly human error. 2009-08-05 23:24:16 +0200 kohei r274702 : correct error message on matrix fragment. 2009-08-05 20:00:12 +0200 kohei r274699 : removed header includes for indexmap.hxx. 2009-08-05 19:54:24 +0200 kohei r274698 : removed ScIndexMap entirely - we don't need this any more. 2009-08-05 19:53:01 +0200 kohei r274697 : Removed duplicated methods that use ScIndexMap. We should now use ScRangeData::IndexMap across the board. 2009-08-05 18:45:17 +0200 kohei r274695 : Refactored code to remove redundant ScDocument::CopyToClip method. 2009-07-21 18:03:54 +0200 kohei r274209 : #i25855# initial commit of the patch from ooo-build. It's buildable.
2009-09-09 07:31:32 +00:00
NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc);
xPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->xPoolHelper->GetStylePool() );
2000-09-18 23:16:46 +00:00
}
//------------------------------------------------------------------------
void ScDocument::InvalidateTextWidth( const rtl::OUString& rStyleName )
2000-09-18 23:16:46 +00:00
{
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && maTabs[i]; i++ )
if ( maTabs[i]->GetPageStyle() == rStyleName )
2000-09-18 23:16:46 +00:00
InvalidateTextWidth( i );
}
//------------------------------------------------------------------------
void ScDocument::InvalidateTextWidth( SCTAB nTab )
2000-09-18 23:16:46 +00:00
{
ScAddress aAdrFrom( 0, 0, nTab );
ScAddress aAdrTo ( MAXCOL, MAXROW, nTab );
InvalidateTextWidth( &aAdrFrom, &aAdrTo, false );
2000-09-18 23:16:46 +00:00
}
//------------------------------------------------------------------------
bool ScDocument::IsPageStyleInUse( const rtl::OUString& rStrPageStyle, SCTAB* pInTab )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bInUse = false;
const SCTAB nCount = GetTableCount();
SCTAB i;
2000-09-18 23:16:46 +00:00
for ( i = 0; !bInUse && i < nCount && maTabs[i]; i++ )
bInUse = ( maTabs[i]->GetPageStyle() == rStrPageStyle );
2000-09-18 23:16:46 +00:00
if ( pInTab )
*pInTab = i-1;
return bInUse;
}
//------------------------------------------------------------------------
bool ScDocument::RemovePageStyleInUse( const rtl::OUString& rStyle )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
2000-09-18 23:16:46 +00:00
for ( SCTAB i=0; i<nCount && maTabs[i]; i++ )
if ( maTabs[i]->GetPageStyle() == rStyle )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bWasInUse = true;
maTabs[i]->SetPageStyle( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
2000-09-18 23:16:46 +00:00
}
return bWasInUse;
}
bool ScDocument::RenamePageStyleInUse( const rtl::OUString& rOld, const rtl::OUString& rNew )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
2000-09-18 23:16:46 +00:00
for ( SCTAB i=0; i<nCount && maTabs[i]; i++ )
if ( maTabs[i]->GetPageStyle() == rOld )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bWasInUse = true;
maTabs[i]->SetPageStyle( rNew );
2000-09-18 23:16:46 +00:00
}
return bWasInUse;
}
//------------------------------------------------------------------------
sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
{
EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT;
rtl::OUString aStyleName = GetPageStyle( nTab );
SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
if ( pStyle )
{
SfxItemSet& rStyleSet = pStyle->GetItemSet();
SvxFrameDirection eDirection = (SvxFrameDirection)
((const SvxFrameDirectionItem&)rStyleSet.Get( ATTR_WRITINGDIR )).GetValue();
if ( eDirection == FRMDIR_HORI_LEFT_TOP )
eRet = EE_HTEXTDIR_L2R;
else if ( eDirection == FRMDIR_HORI_RIGHT_TOP )
eRet = EE_HTEXTDIR_R2L;
// else (invalid for EditEngine): keep "default"
}
return sal::static_int_cast<sal_uInt8>(eRet);
}
ScMacroManager* ScDocument::GetMacroManager()
{
if (!mpMacroMgr.get())
mpMacroMgr.reset(new ScMacroManager(this));
return mpMacroMgr.get();
}
//------------------------------------------------------------------------
void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
2011-11-05 07:00:32 +01:00
bool bNumFormatChanged )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bBroadcast = (bNumFormatChanged && GetDocOptions().IsCalcAsShown() && !IsImportingXML() && !IsClipboard());
2000-09-18 23:16:46 +00:00
if ( pAdrFrom && !pAdrTo )
{
const SCTAB nTab = pAdrFrom->Tab();
2000-09-18 23:16:46 +00:00
if (nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->InvalidateTextWidth( pAdrFrom, NULL, bNumFormatChanged, bBroadcast );
2000-09-18 23:16:46 +00:00
}
else
{
const SCTAB nTabStart = pAdrFrom ? pAdrFrom->Tab() : 0;
const SCTAB nTabEnd = pAdrTo ? pAdrTo->Tab() : MAXTAB;
2000-09-18 23:16:46 +00:00
for ( SCTAB nTab=nTabStart; nTab<=nTabEnd && nTab < static_cast<SCTAB>(maTabs.size()); nTab++ )
if ( maTabs[nTab] )
maTabs[nTab]->InvalidateTextWidth( pAdrFrom, pAdrTo, bNumFormatChanged, bBroadcast );
2000-09-18 23:16:46 +00:00
}
}
//------------------------------------------------------------------------
#define CALCMAX 1000 // Berechnungen
#define ABORT_EVENTS (VCL_INPUT_ANY & ~VCL_INPUT_TIMER & ~VCL_INPUT_OTHER)
2000-09-18 23:16:46 +00:00
2011-11-05 07:00:32 +01:00
bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder versuchen
2000-09-18 23:16:46 +00:00
{
// #i75610# if a printer hasn't been set or created yet, don't create one for this
if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(false) == NULL )
return false;
2011-11-05 07:00:32 +01:00
bIdleDisabled = true;
2000-09-18 23:16:46 +00:00
const sal_uLong nStart = Time::GetSystemTicks();
2000-09-18 23:16:46 +00:00
OutputDevice* pDev = NULL;
MapMode aOldMap;
ScStyleSheet* pStyle = NULL;
ScColumnIterator* pColIter = NULL;
ScTable* pTable = NULL;
ScColumn* pColumn = NULL;
ScBaseCell* pCell = NULL;
SCTAB nTab = aCurTextWidthCalcPos.Tab();
SCROW nRow = aCurTextWidthCalcPos.Row();
SCsCOL nCol = aCurTextWidthCalcPos.Col();
2011-11-05 07:00:32 +01:00
bool bNeedMore= false;
2000-09-18 23:16:46 +00:00
if ( !ValidRow(nRow) )
2000-09-18 23:16:46 +00:00
nRow = 0, nCol--;
if ( nCol < 0 )
nCol = MAXCOL, nTab++;
if ( !ValidTab(nTab) || nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab] )
2000-09-18 23:16:46 +00:00
nTab = 0;
// SearchMask/Family muss gemerkt werden,
// damit z.B. der Organizer nicht durcheinanderkommt, wenn zwischendurch eine
// Query-Box aufgemacht wird !!!
ScStyleSheetPool* pStylePool = xPoolHelper->GetStylePool();
sal_uInt16 nOldMask = pStylePool->GetSearchMask();
2000-09-18 23:16:46 +00:00
SfxStyleFamily eOldFam = pStylePool->GetSearchFamily();
pTable = maTabs[nTab];
2000-09-18 23:16:46 +00:00
pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL );
pStyle = (ScStyleSheet*)pStylePool->Find( pTable->aPageStyle,
SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyle, "Missing StyleSheet :-/" );
2000-09-18 23:16:46 +00:00
2011-11-05 07:00:32 +01:00
bool bProgress = false;
2000-09-18 23:16:46 +00:00
if ( pStyle && 0 == GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALETOPAGES) )
{
sal_uInt16 nRestart = 0;
sal_uInt16 nZoom = 0;
sal_uInt16 nCount = 0;
2000-09-18 23:16:46 +00:00
nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE);
Fraction aZoomFract( nZoom, 100 );
pColumn = &pTable->aCol[nCol];
pColIter = new ScColumnIterator( pColumn, nRow, MAXROW );
while ( (nZoom > 0) && (nCount < CALCMAX) && (nRestart < 2) )
{
if ( pColIter->Next( nRow, pCell ) )
{
if ( TEXTWIDTH_DIRTY == pCell->GetTextWidth() )
{
double nPPTX = 0.0;
double nPPTY = 0.0;
2000-09-18 23:16:46 +00:00
if ( !pDev )
{
pDev = GetPrinter();
aOldMap = pDev->GetMapMode();
pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize
Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
nPPTX = aPix1000.X() / 1000.0;
nPPTY = aPix1000.Y() / 1000.0;
}
if ( !bProgress && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->GetDirty() )
{
ScProgress::CreateInterpretProgress( this, false );
2011-11-05 07:00:32 +01:00
bProgress = true;
2000-09-18 23:16:46 +00:00
}
sal_uInt16 nNewWidth = (sal_uInt16)GetNeededSize( nCol, nRow, nTab,
2000-09-18 23:16:46 +00:00
pDev, nPPTX, nPPTY,
2011-11-05 07:00:32 +01:00
aZoomFract,aZoomFract, true,
true ); // bTotalSize
2000-09-18 23:16:46 +00:00
pCell->SetTextWidth( nNewWidth );
2011-11-05 07:00:32 +01:00
bNeedMore = true;
2000-09-18 23:16:46 +00:00
}
}
else
{
2011-11-05 07:00:32 +01:00
bool bNewTab = false;
2000-09-18 23:16:46 +00:00
nRow = 0;
nCol--;
if ( nCol < 0 )
{
nCol = MAXCOL;
nTab++;
2011-11-05 07:00:32 +01:00
bNewTab = true;
2000-09-18 23:16:46 +00:00
}
if ( !ValidTab(nTab) || nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab] )
2000-09-18 23:16:46 +00:00
{
nTab = 0;
nRestart++;
2011-11-05 07:00:32 +01:00
bNewTab = true;
2000-09-18 23:16:46 +00:00
}
if ( nRestart < 2 )
{
if ( bNewTab )
{
pTable = maTabs[nTab];
2000-09-18 23:16:46 +00:00
pStyle = (ScStyleSheet*)pStylePool->Find( pTable->aPageStyle,
SFX_STYLE_FAMILY_PAGE );
if ( pStyle )
{
SfxItemSet& rSet = pStyle->GetItemSet();
if ( GET_SCALEVALUE( rSet, ATTR_PAGE_SCALETOPAGES ) == 0 )
nZoom = GET_SCALEVALUE(rSet, ATTR_PAGE_SCALE );
else
nZoom = 0;
}
else
{
2011-03-01 19:05:02 +01:00
OSL_FAIL( "Missing StyleSheet :-/" );
}
2000-09-18 23:16:46 +00:00
}
if ( nZoom > 0 )
{
delete pColIter;
pColumn = &pTable->aCol[nCol];
pColIter = new ScColumnIterator( pColumn, nRow, MAXROW );
}
else
nTab++; // Tabelle nicht mit absolutem Zoom -> naechste
}
}
nCount++;
// Idle Berechnung abbrechen, wenn Berechnungen laenger als
// 50ms dauern, oder nach 32 Berechnungen mal nachschauen, ob
// bestimmte Events anstehen, die Beachtung wuenschen:
if ( ( 50L < Time::GetSystemTicks() - nStart )
2000-09-18 23:16:46 +00:00
|| ( !(nCount&31) && Application::AnyInput( ABORT_EVENTS ) ) )
nCount = CALCMAX;
}
}
else
nTab++; // Tabelle nicht mit absolutem Zoom -> naechste
if ( bProgress )
ScProgress::DeleteInterpretProgress();
delete pColIter;
if (pDev)
pDev->SetMapMode(aOldMap);
aCurTextWidthCalcPos.SetTab( nTab );
aCurTextWidthCalcPos.SetRow( nRow );
aCurTextWidthCalcPos.SetCol( (SCCOL)nCol );
2000-09-18 23:16:46 +00:00
pStylePool->SetSearchMask( eOldFam, nOldMask );
bIdleDisabled = false;
2000-09-18 23:16:46 +00:00
return bNeedMore;
}
//------------------------------------------------------------------------
class ScSpellStatus
{
public:
2011-11-05 07:00:32 +01:00
bool bModified;
2000-09-18 23:16:46 +00:00
ScSpellStatus() : bModified(false) {};
2000-09-18 23:16:46 +00:00
DECL_LINK (EventHdl, EditStatus*);
};
IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus )
{
sal_uLong nStatus = pStatus->GetStatusWord();
2000-09-18 23:16:46 +00:00
if ( nStatus & EE_STAT_WRONGWORDCHANGED )
2011-11-05 07:00:32 +01:00
bModified = true;
2000-09-18 23:16:46 +00:00
return 0;
}
// SPELL_MAXCELLS muss mindestens 256 sein, solange am Iterator keine
// Start-Spalte gesetzt werden kann
//! SPELL_MAXTEST fuer Timer und Idle unterschiedlich ???
// SPELL_MAXTEST now divided between visible and rest of document
#define SPELL_MAXTEST_VIS 1
#define SPELL_MAXTEST_ALL 3
#define SPELL_MAXCELLS 256
2011-11-05 07:00:32 +01:00
bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos,
sal_uInt16 nMaxTest )
2000-09-18 23:16:46 +00:00
{
ScEditEngineDefaulter* pEngine = NULL; //! am Dokument speichern
SfxItemSet* pDefaults = NULL;
ScSpellStatus aStatus;
sal_uInt16 nCellCount = 0; // Zellen insgesamt
sal_uInt16 nTestCount = 0; // Aufrufe Spelling
2011-11-05 07:00:32 +01:00
bool bChanged = false; // Aenderungen?
2000-09-18 23:16:46 +00:00
SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge
SCROW nRow = rSpellPos.Row();
SCTAB nTab = rSpellPos.Tab();
if ( nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab] ) // sheet deleted?
2000-09-18 23:16:46 +00:00
{
nTab = rSpellRange.aStart.Tab();
nRow = rSpellRange.aStart.Row();
if ( nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab] )
2000-09-18 23:16:46 +00:00
{
// may happen for visible range
return false;
2000-09-18 23:16:46 +00:00
}
}
ScHorizontalCellIterator aIter( this, nTab,
rSpellRange.aStart.Col(), nRow,
rSpellRange.aEnd.Col(), rSpellRange.aEnd.Row() );
ScBaseCell* pCell = aIter.GetNext( nCol, nRow );
// skip everything left of rSpellPos:
while ( pCell && nRow == rSpellPos.Row() && nCol < rSpellPos.Col() )
pCell = aIter.GetNext( nCol, nRow );
for (; pCell; pCell = aIter.GetNext(nCol, nRow))
2000-09-18 23:16:46 +00:00
{
if (pDPCollection && pDPCollection->HasDPTable(nCol, nRow, nTab))
// Don't spell check within datapilot table.
continue;
2000-09-18 23:16:46 +00:00
CellType eType = pCell->GetCellType();
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
{
if (!pEngine)
{
2011-02-27 23:59:21 +01:00
// ScTabEditEngine is needed
2000-09-18 23:16:46 +00:00
// because MapMode must be set for some old documents
pEngine = new ScTabEditEngine( this );
pEngine->SetControlWord( pEngine->GetControlWord() |
( EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS ) );
pEngine->SetStatusEventHdl( LINK( &aStatus, ScSpellStatus, EventHdl ) );
// Delimiters hier wie in inputhdl.cxx !!!
pEngine->SetWordDelimiters(
ScEditUtil::ModifyDelimiters( pEngine->GetWordDelimiters() ) );
pDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() );
2001-12-05 11:47:07 +00:00
com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellChecker1> xXSpellChecker1( LinguMgr::GetSpellChecker() );
pEngine->SetSpeller( xXSpellChecker1 );
2000-09-18 23:16:46 +00:00
}
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
pPattern->FillEditItemSet( pDefaults );
pEngine->SetDefaults( pDefaults, false ); //! noetig ?
2000-09-18 23:16:46 +00:00
sal_uInt16 nCellLang = ((const SvxLanguageItem&)
2000-09-18 23:16:46 +00:00
pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue();
if ( nCellLang == LANGUAGE_SYSTEM )
nCellLang = Application::GetSettings().GetLanguage(); // never use SYSTEM for spelling
2000-09-18 23:16:46 +00:00
pEngine->SetDefaultLanguage( nCellLang );
if ( eType == CELLTYPE_STRING )
{
2012-02-27 09:45:35 +00:00
rtl::OUString aText = static_cast<ScStringCell*>(pCell)->GetString();
2000-09-18 23:16:46 +00:00
pEngine->SetText( aText );
}
else
pEngine->SetText( *(static_cast<ScEditCell*>(pCell)->GetData() ) );
2000-09-18 23:16:46 +00:00
aStatus.bModified = false;
2000-09-18 23:16:46 +00:00
pEngine->CompleteOnlineSpelling();
if ( aStatus.bModified ) // Fehler dazu oder weggekommen?
{
2011-11-05 07:00:32 +01:00
bool bNeedEdit = true; // Test auf einfachen Text
2000-09-18 23:16:46 +00:00
if ( !pEngine->HasOnlineSpellErrors() )
{
ScEditAttrTester aTester( pEngine );
bNeedEdit = aTester.NeedsObject();
}
if ( bNeedEdit )
{
EditTextObject* pNewData = pEngine->CreateTextObject();
if ( eType == CELLTYPE_EDIT )
((ScEditCell*)pCell)->SetData( pNewData,
pEngine->GetEditTextObjectPool() );
else
PutCell( nCol, nRow, nTab, new ScEditCell( pNewData,
this, pEngine->GetEditTextObjectPool() ) );
delete pNewData;
}
else // einfacher String
PutCell( nCol, nRow, nTab, new ScStringCell( pEngine->GetText() ) );
// Paint
if (pShell)
{
2011-02-27 23:59:21 +01:00
// Seitenvorschau ist davon nicht betroffen
2000-09-18 23:16:46 +00:00
// (sollte jedenfalls nicht)
ScPaintHint aHint( ScRange( nCol, nRow, nTab ), PAINT_GRID );
aHint.SetPrintFlag( false );
2000-09-18 23:16:46 +00:00
pShell->Broadcast( aHint );
}
2011-11-05 07:00:32 +01:00
bChanged = true;
2000-09-18 23:16:46 +00:00
}
if ( ++nTestCount >= nMaxTest ) // checked enough text?
break;
}
if ( ++nCellCount >= SPELL_MAXCELLS ) // seen enough cells?
break;
}
if ( pCell )
{
++nCol; // continue after last cell
if ( nCol > rSpellRange.aEnd.Col() )
{
nCol = rSpellRange.aStart.Col();
++nRow;
if ( nRow > rSpellRange.aEnd.Row() )
pCell = NULL;
}
}
if (!pCell) // end of range reached -> next sheet
{
++nTab;
if ( nTab > rSpellRange.aEnd.Tab() || nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab] )
2000-09-18 23:16:46 +00:00
nTab = rSpellRange.aStart.Tab();
nCol = rSpellRange.aStart.Col();
nRow = rSpellRange.aStart.Row();
nVisSpellState = VSPL_DONE; //! only if this is for the visible range
}
rSpellPos.Set( nCol, nRow, nTab );
delete pDefaults;
delete pEngine; // bevor aStatus out of scope geht
return bChanged;
}
2011-11-05 07:00:32 +01:00
bool ScDocument::ContinueOnlineSpelling()
2000-09-18 23:16:46 +00:00
{
if ( bIdleDisabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly()) )
return false;
2000-09-18 23:16:46 +00:00
// #i48433# set bInsertingFromOtherDoc flag so there are no broadcasts when PutCell is called
// (same behavior as in RemoveAutoSpellObj: just transfer the broadcaster)
2011-11-05 07:00:32 +01:00
bool bOldInserting = IsInsertingFromOtherDoc();
SetInsertingFromOtherDoc( true );
2000-09-18 23:16:46 +00:00
//! use one EditEngine for both calls
2011-02-27 23:59:21 +01:00
// first check visible range
2011-11-05 07:00:32 +01:00
bool bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS );
2000-09-18 23:16:46 +00:00
// during first pass through visible range, always continue
if ( nVisSpellState == VSPL_START )
2011-11-05 07:00:32 +01:00
bResult = true;
2000-09-18 23:16:46 +00:00
if (bResult)
{
// if errors found, continue there
OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_ALL );
}
else
{
// if nothing found there, continue with rest of document
ScRange aTotalRange( 0,0,0, MAXCOL,MAXROW,MAXTAB );
bResult = OnlineSpellInRange( aTotalRange, aOnlineSpellPos, SPELL_MAXTEST_ALL );
}
SetInsertingFromOtherDoc( bOldInserting );
2000-09-18 23:16:46 +00:00
return bResult;
}
void ScDocument::SetOnlineSpellPos( const ScAddress& rPos )
{
aOnlineSpellPos = rPos;
// skip visible area for aOnlineSpellPos
if ( aVisSpellRange.In( aOnlineSpellPos ) )
aOnlineSpellPos = aVisSpellRange.aEnd;
}
2011-11-05 07:00:32 +01:00
bool ScDocument::SetVisibleSpellRange( const ScRange& rNewRange )
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bChange = ( aVisSpellRange != rNewRange );
2000-09-18 23:16:46 +00:00
if (bChange)
{
// continue spelling through visible range when scrolling down
2011-11-05 07:00:32 +01:00
bool bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) &&
2000-09-18 23:16:46 +00:00
rNewRange.aStart.Row() > aVisSpellRange.aStart.Row() &&
rNewRange.aStart.Col() == aVisSpellRange.aStart.Col() &&
rNewRange.aEnd.Col() == aVisSpellRange.aEnd.Col() );
aVisSpellRange = rNewRange;
if ( !bContDown )
{
aVisSpellPos = aVisSpellRange.aStart;
nVisSpellState = VSPL_START;
}
// skip visible area for aOnlineSpellPos
if ( aVisSpellRange.In( aOnlineSpellPos ) )
aOnlineSpellPos = aVisSpellRange.aEnd;
}
return bChange;
}
void ScDocument::RemoveAutoSpellObj()
{
// alle Spelling-Informationen entfernen
for (SCTAB nTab=0; nTab< static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]; nTab++)
maTabs[nTab]->RemoveAutoSpellObj();
2000-09-18 23:16:46 +00:00
}
void ScDocument::RepaintRange( const ScRange& rRange )
{
if ( bIsVisible && pShell )
{
ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
if ( pModel )
pModel->RepaintRange( rRange ); // locked repaints are checked there
}
}
2000-09-18 23:16:46 +00:00
//------------------------------------------------------------------------
2011-11-05 07:00:32 +01:00
bool ScDocument::IdleCheckLinks() // true = demnaechst wieder versuchen
2000-09-18 23:16:46 +00:00
{
2011-11-05 07:00:32 +01:00
bool bAnyLeft = false;
2000-09-18 23:16:46 +00:00
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
2000-09-18 23:16:46 +00:00
{
ScDdeLink* pDdeLink = (ScDdeLink*)pBase;
if (pDdeLink->NeedsUpdate())
{
pDdeLink->TryUpdate();
if (pDdeLink->NeedsUpdate()) // war nix?
2011-11-05 07:00:32 +01:00
bAnyLeft = true;
}
2000-09-18 23:16:46 +00:00
}
}
}
return bAnyLeft;
}
void ScDocument::SaveDdeLinks(SvStream& rStream) const
{
// bei 4.0-Export alle mit Modus != DEFAULT weglassen
2011-11-05 07:00:32 +01:00
bool bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 );
2000-09-18 23:16:46 +00:00
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
const ::sfx2::SvBaseLinks& rLinks = GetLinkManager()->GetLinks();
sal_uInt16 nCount = rLinks.size();
2000-09-18 23:16:46 +00:00
// erstmal zaehlen...
sal_uInt16 nDdeCount = 0;
sal_uInt16 i;
2000-09-18 23:16:46 +00:00
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
2000-09-18 23:16:46 +00:00
if (pBase->ISA(ScDdeLink))
if ( !bExport40 || ((ScDdeLink*)pBase)->GetMode() == SC_DDE_DEFAULT )
++nDdeCount;
}
// Header
ScMultipleWriteHeader aHdr( rStream );
rStream << nDdeCount;
// Links speichern
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
2000-09-18 23:16:46 +00:00
if (pBase->ISA(ScDdeLink))
{
ScDdeLink* pLink = (ScDdeLink*)pBase;
if ( !bExport40 || pLink->GetMode() == SC_DDE_DEFAULT )
pLink->Store( rStream, aHdr );
}
}
}
void ScDocument::LoadDdeLinks(SvStream& rStream)
{
ScMultipleReadHeader aHdr( rStream );
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
GetLinkManager();
sal_uInt16 nCount;
2000-09-18 23:16:46 +00:00
rStream >> nCount;
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
ScDdeLink* pLink = new ScDdeLink( this, rStream, aHdr );
pLinkManager->InsertDDELink( pLink,
2000-09-18 23:16:46 +00:00
pLink->GetAppl(), pLink->GetTopic(), pLink->GetItem() );
}
}
bool ScDocument::HasDdeLinks() const
2000-09-18 23:16:46 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
if ((*rLinks[i])->ISA(ScDdeLink))
return true;
2000-09-18 23:16:46 +00:00
}
return false;
2000-09-18 23:16:46 +00:00
}
2011-11-05 07:00:32 +01:00
void ScDocument::SetInLinkUpdate(bool bSet)
2000-09-18 23:16:46 +00:00
{
// called from TableLink and AreaLink
OSL_ENSURE( bInLinkUpdate != bSet, "SetInLinkUpdate twice" );
2000-09-18 23:16:46 +00:00
bInLinkUpdate = bSet;
}
2011-11-05 07:00:32 +01:00
bool ScDocument::IsInLinkUpdate() const
2000-09-18 23:16:46 +00:00
{
return bInLinkUpdate || IsInDdeLinkUpdate();
2000-09-18 23:16:46 +00:00
}
void ScDocument::UpdateExternalRefLinks(Window* pWin)
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (!GetLinkManager())
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
return;
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
bool bAny = false;
for (sal_uInt16 i = 0; i < nCount; ++i)
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
ScExternalRefLink* pRefLink = dynamic_cast<ScExternalRefLink*>(pBase);
if (pRefLink)
{
if (pRefLink->Update())
bAny = true;
else
{
// Update failed. Notify the user.
rtl::OUString aFile;
pLinkManager->GetDisplayNames(pRefLink, NULL, &aFile, NULL, NULL);
// Decode encoded URL for display friendliness.
INetURLObject aUrl(aFile,INetURLObject::WAS_ENCODED);
aFile = aUrl.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS);
rtl::OUStringBuffer aBuf;
aBuf.append(String(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
aBuf.appendAscii("\n\n");
aBuf.append(aFile);
ErrorBox aBox(pWin, WB_OK, aBuf.makeStringAndClear());
aBox.Execute();
}
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
}
}
if (bAny)
{
TrackFormulas();
pShell->Broadcast( SfxSimpleHint(FID_DATACHANGED) );
CWS-TOOLING: integrate CWS calc50 2009-05-28 12:32:46 +0200 nn r272399 : gcc warning 2009-05-28 10:56:48 +0200 nn r272382 : CWS-TOOLING: rebase CWS calc50 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 14:24:52 +0200 nn r272343 : #i50825# DataPilotUpdate: prevent overwriting source data above the table 2009-05-26 18:29:21 +0200 nn r272316 : #i50019# allow borders for multiple cell ranges 2009-05-26 13:43:36 +0200 nn r272300 : #i101960# UpdateExternalRefLinks: set document modified 2009-05-25 18:01:23 +0200 nn r272267 : #i102056# copied from CWS calc311fixes 2009-05-20 12:24:22 +0200 nn r272114 : #i59672# ExecFilter/SC_AUTOFILTER_CUSTOM: select database range (patch from gaozm) 2009-05-15 18:24:44 +0200 nn r271961 : #i100544# correct ScTokenConversion::ConvertToTokenArray 2009-05-13 17:45:02 +0200 nn r271866 : #i101869# DeleteRange: before broadcasting, check if EndListening removed the note cells 2009-05-13 12:43:31 +0200 nn r271856 : #i101806# correct reference undo for inserting/deleting columns/rows across sheets 2009-05-11 18:44:46 +0200 nn r271783 : #i101725# don't copy hash_set with pointers from the other collection 2009-05-11 17:54:21 +0200 nn r271780 : #i101690# correct merge error in frmdlg integration 2009-05-07 15:28:55 +0200 nn r271674 : #i96940# check for negative count in fillAuto 2009-05-07 13:47:58 +0200 nn r271661 : #i101512# SetCompileForFAP is in formula::FormulaCompiler 2009-05-07 13:47:27 +0200 nn r271660 : #i101512# use SetCompileForFAP for CompileTokenArray 2009-05-05 18:47:03 +0200 nn r271551 : #i73074# RepeatDB: re-evaluate advanced filter source range 2009-05-05 18:23:21 +0200 nn r271546 : #i97857# use GetInputString for direct reference as validity range source 2009-05-05 17:38:23 +0200 nn r271538 : #i95834# better enable/disable handling of next/previous buttons (patch by cmc)
2009-06-15 10:46:14 +00:00
// #i101960# set document modified, as in TrackTimeHdl for DDE links
if (!pShell->IsModified())
{
2011-11-05 07:00:32 +01:00
pShell->SetModified( true );
CWS-TOOLING: integrate CWS calc50 2009-05-28 12:32:46 +0200 nn r272399 : gcc warning 2009-05-28 10:56:48 +0200 nn r272382 : CWS-TOOLING: rebase CWS calc50 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 14:24:52 +0200 nn r272343 : #i50825# DataPilotUpdate: prevent overwriting source data above the table 2009-05-26 18:29:21 +0200 nn r272316 : #i50019# allow borders for multiple cell ranges 2009-05-26 13:43:36 +0200 nn r272300 : #i101960# UpdateExternalRefLinks: set document modified 2009-05-25 18:01:23 +0200 nn r272267 : #i102056# copied from CWS calc311fixes 2009-05-20 12:24:22 +0200 nn r272114 : #i59672# ExecFilter/SC_AUTOFILTER_CUSTOM: select database range (patch from gaozm) 2009-05-15 18:24:44 +0200 nn r271961 : #i100544# correct ScTokenConversion::ConvertToTokenArray 2009-05-13 17:45:02 +0200 nn r271866 : #i101869# DeleteRange: before broadcasting, check if EndListening removed the note cells 2009-05-13 12:43:31 +0200 nn r271856 : #i101806# correct reference undo for inserting/deleting columns/rows across sheets 2009-05-11 18:44:46 +0200 nn r271783 : #i101725# don't copy hash_set with pointers from the other collection 2009-05-11 17:54:21 +0200 nn r271780 : #i101690# correct merge error in frmdlg integration 2009-05-07 15:28:55 +0200 nn r271674 : #i96940# check for negative count in fillAuto 2009-05-07 13:47:58 +0200 nn r271661 : #i101512# SetCompileForFAP is in formula::FormulaCompiler 2009-05-07 13:47:27 +0200 nn r271660 : #i101512# use SetCompileForFAP for CompileTokenArray 2009-05-05 18:47:03 +0200 nn r271551 : #i73074# RepeatDB: re-evaluate advanced filter source range 2009-05-05 18:23:21 +0200 nn r271546 : #i97857# use GetInputString for direct reference as validity range source 2009-05-05 17:38:23 +0200 nn r271538 : #i95834# better enable/disable handling of next/previous buttons (patch by cmc)
2009-06-15 10:46:14 +00:00
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
{
pBindings->Invalidate( SID_SAVEDOC );
pBindings->Invalidate( SID_DOC_MODIFIED );
}
}
CWS-TOOLING: integrate CWS mooxlsc 2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning 2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze 2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze 2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon 2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon 2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon 2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36) 2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented 2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written 2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references 2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix 2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT 2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list 2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness 2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names. For now, we don't support per-sheet external names. Let's throw in NoName error until they are supported. 2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which prevented cached external names with range references from being imported correctly. P.S. I swear I thought I had covered this.... 2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import 2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager 2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import 2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import 2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ... 2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed 2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused 2008-10-31 00:13:53 +0100 er r262841 : merge error 2008-10-31 00:05:39 +0100 er r262840 : merge error 2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?! 2008-10-30 22:59:11 +0100 er r262838 : merge error 2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34) 2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
2008-12-12 09:38:47 +00:00
}
}
void ScDocument::UpdateDdeLinks(Window* pWin)
2000-09-18 23:16:46 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
sal_uInt16 i;
2011-02-27 23:59:21 +01:00
// falls das Updaten laenger dauert, erstmal alle Werte
// zuruecksetzen, damit nichts altes (falsches) stehen bleibt
bool bAny = false;
for (i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (pDdeLink)
{
if (pDdeLink->Update())
bAny = true;
else
{
// Update failed. Notify the user.
rtl::OUString aFile = pDdeLink->GetTopic();
rtl::OUString aElem = pDdeLink->GetItem();
rtl::OUString aType = pDdeLink->GetAppl();
rtl::OUStringBuffer aBuf;
aBuf.append(String(ScResId(SCSTR_DDEDOC_NOT_LOADED)));
aBuf.appendAscii("\n\n");
aBuf.appendAscii("Source : ");
aBuf.append(aFile);
aBuf.appendAscii("\nElement : ");
aBuf.append(aElem);
aBuf.appendAscii("\nType : ");
aBuf.append(aType);
ErrorBox aBox(pWin, WB_OK, aBuf.makeStringAndClear());
aBox.Execute();
}
}
2000-09-18 23:16:46 +00:00
}
if (bAny)
{
// Formeln berechnen und painten wie im TrackTimeHdl
TrackFormulas();
pShell->Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
2000-09-18 23:16:46 +00:00
// wenn FID_DATACHANGED irgendwann mal asynchron werden sollte
// (z.B. mit Invalidate am Window), muss hier ein Update erzwungen werden.
}
2000-09-18 23:16:46 +00:00
pLinkManager->CloseCachedComps();
2000-09-18 23:16:46 +00:00
}
}
bool ScDocument::UpdateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem )
2000-09-18 23:16:46 +00:00
{
// fuer refresh() per StarOne Api
// ResetValue() fuer einzelnen Link nicht noetig
//! wenn's mal alles asynchron wird, aber auch hier
2011-11-05 07:00:32 +01:00
bool bFound = false;
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
2000-09-18 23:16:46 +00:00
{
ScDdeLink* pDdeLink = (ScDdeLink*)pBase;
if ( rtl::OUString(pDdeLink->GetAppl()) == rAppl &&
rtl::OUString(pDdeLink->GetTopic()) == rTopic &&
rtl::OUString(pDdeLink->GetItem()) == rItem )
{
pDdeLink->TryUpdate();
2011-11-05 07:00:32 +01:00
bFound = true; // koennen theoretisch mehrere sein (Mode), darum weitersuchen
}
2000-09-18 23:16:46 +00:00
}
}
pLinkManager->CloseCachedComps();
2000-09-18 23:16:46 +00:00
}
return bFound;
}
void ScDocument::DisconnectDdeLinks()
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
2000-09-18 23:16:46 +00:00
if (pBase->ISA(ScDdeLink))
pBase->Disconnect(); // bleibt im LinkManager eingetragen
}
}
}
void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
{
if (bIsClip) // aus Stream erzeugen
{
if (pClipData)
{
pClipData->Seek(0);
pDestDoc->LoadDdeLinks(*pClipData);
}
}
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
else if (GetLinkManager()) // Links direkt kopieren
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
2000-09-18 23:16:46 +00:00
if (pBase->ISA(ScDdeLink))
{
ScDdeLink* pNew = new ScDdeLink( pDestDoc, *(ScDdeLink*)pBase );
pDestDoc->pLinkManager->InsertDDELink( pNew,
2000-09-18 23:16:46 +00:00
pNew->GetAppl(), pNew->GetTopic(), pNew->GetItem() );
}
}
}
}
sal_uInt16 ScDocument::GetDdeLinkCount() const
2000-09-18 23:16:46 +00:00
{
sal_uInt16 nDdeCount = 0;
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
if ((*rLinks[i])->ISA(ScDdeLink))
++nDdeCount;
}
return nDdeCount;
}
// ----------------------------------------------------------------------------
namespace {
/** Tries to find the specified DDE link.
@param pnDdePos (out-param) if not 0, the index of the DDE link is returned here
(does not include other links from link manager).
@return The DDE link, if it exists, otherwise 0. */
ScDdeLink* lclGetDdeLink(
2010-01-13 22:25:07 +01:00
const sfx2::LinkManager* pLinkManager,
const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode,
sal_uInt16* pnDdePos = NULL )
2000-09-18 23:16:46 +00:00
{
if( pLinkManager )
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
if( pnDdePos ) *pnDdePos = 0;
for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
2000-09-18 23:16:46 +00:00
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
2000-09-18 23:16:46 +00:00
{
if( (rtl::OUString(pDdeLink->GetAppl()) == rAppl) &&
(rtl::OUString(pDdeLink->GetTopic()) == rTopic) &&
(rtl::OUString(pDdeLink->GetItem()) == rItem) &&
((nMode == SC_DDE_IGNOREMODE) || (nMode == pDdeLink->GetMode())) )
return pDdeLink;
if( pnDdePos ) ++*pnDdePos;
2000-09-18 23:16:46 +00:00
}
}
}
return NULL;
2000-09-18 23:16:46 +00:00
}
/** Returns a pointer to the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@return The DDE link, if it exists, otherwise 0. */
ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDdePos )
{
if( pLinkManager )
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
sal_uInt16 nDdeIndex = 0; // counts only the DDE links
for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
{
if( nDdeIndex == nDdePos )
return pDdeLink;
++nDdeIndex;
}
}
}
return NULL;
}
} // namespace
// ----------------------------------------------------------------------------
bool ScDocument::FindDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos )
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL;
}
bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, rtl::OUString& rAppl, rtl::OUString& rTopic, rtl::OUString& rItem ) const
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
rAppl = pDdeLink->GetAppl();
rTopic = pDdeLink->GetTopic();
rItem = pDdeLink->GetItem();
return true;
}
return false;
}
bool ScDocument::GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
rnMode = pDdeLink->GetMode();
return true;
}
return false;
}
const ScMatrix* ScDocument::GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos );
return pDdeLink ? pDdeLink->GetResult() : NULL;
}
bool ScDocument::CreateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
{
/* Create a DDE link without updating it (i.e. for Excel import), to prevent
unwanted connections. First try to find existing link. Set result array
on existing and new links. */
//! store DDE links additionally at document (for efficiency)?
OSL_ENSURE( nMode != SC_DDE_IGNOREMODE, "ScDocument::CreateDdeLink - SC_DDE_IGNOREMODE not allowed here" );
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if( GetLinkManager() && (nMode != SC_DDE_IGNOREMODE) )
{
ScDdeLink* pDdeLink = lclGetDdeLink( pLinkManager, rAppl, rTopic, rItem, nMode );
if( !pDdeLink )
{
// create a new DDE link, but without TryUpdate
pDdeLink = new ScDdeLink( this, rAppl, rTopic, rItem, nMode );
pLinkManager->InsertDDELink( pDdeLink, rAppl, rTopic, rItem );
}
// insert link results
if( pResults )
pDdeLink->SetResult( pResults );
return true;
}
return false;
}
bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults )
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
pDdeLink->SetResult( pResults );
return true;
}
return false;
}
2000-09-18 23:16:46 +00:00
//------------------------------------------------------------------------
bool ScDocument::HasAreaLinks() const
2000-09-18 23:16:46 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-09-18 23:16:46 +00:00
if ((*rLinks[i])->ISA(ScAreaLink))
return true;
2000-09-18 23:16:46 +00:00
}
return false;
2000-09-18 23:16:46 +00:00
}
void ScDocument::UpdateAreaLinks()
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-09-18 23:16:46 +00:00
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScAreaLink))
pBase->Update();
}
2000-09-18 23:16:46 +00:00
}
}
void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab )
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nPos = 0;
while ( nPos < rLinks.size() )
{
const ::sfx2::SvBaseLink* pBase = *rLinks[nPos];
if ( pBase->ISA(ScAreaLink) &&
static_cast<const ScAreaLink*>(pBase)->GetDestArea().aStart.Tab() == nTab )
pLinkManager->Remove( nPos );
else
++nPos;
}
}
}
2000-10-30 10:33:41 +00:00
void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
2000-10-30 10:33:41 +00:00
{
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
if (GetLinkManager())
2000-10-30 10:33:41 +00:00
{
bool bAnyUpdate = false;
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.size();
for (sal_uInt16 i=0; i<nCount; i++)
2000-10-30 10:33:41 +00:00
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScAreaLink))
{
ScAreaLink* pLink = (ScAreaLink*) pBase;
ScRange aOutRange = pLink->GetDestArea();
SCCOL nCol1 = aOutRange.aStart.Col();
SCROW nRow1 = aOutRange.aStart.Row();
SCTAB nTab1 = aOutRange.aStart.Tab();
SCCOL nCol2 = aOutRange.aEnd.Col();
SCROW nRow2 = aOutRange.aEnd.Row();
SCTAB nTab2 = aOutRange.aEnd.Tab();
ScRefUpdateRes eRes =
ScRefUpdate::Update( this, eUpdateRefMode,
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, nDy, nDz,
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
if ( eRes != UR_NOTHING )
{
pLink->SetDestArea( ScRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ) );
bAnyUpdate = true;
}
}
}
if ( bAnyUpdate )
{
// #i52120# Look for duplicates (after updating all positions).
// If several links start at the same cell, the one with the lower index is removed
// (file format specifies only one link definition for a cell).
sal_uInt16 nFirstIndex = 0;
while ( nFirstIndex < nCount )
{
bool bFound = false;
::sfx2::SvBaseLink* pFirst = *rLinks[nFirstIndex];
if ( pFirst->ISA(ScAreaLink) )
{
ScAddress aFirstPos = static_cast<ScAreaLink*>(pFirst)->GetDestArea().aStart;
for ( sal_uInt16 nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex )
{
::sfx2::SvBaseLink* pSecond = *rLinks[nSecondIndex];
if ( pSecond->ISA(ScAreaLink) &&
static_cast<ScAreaLink*>(pSecond)->GetDestArea().aStart == aFirstPos )
{
// remove the first link, exit the inner loop, don't increment nFirstIndex
pLinkManager->Remove( pFirst );
nCount = rLinks.size();
bFound = true;
}
}
}
if (!bFound)
++nFirstIndex;
}
2000-10-30 10:33:41 +00:00
}
}
}
2000-09-18 23:16:46 +00:00
//------------------------------------------------------------------------
// TimerDelays etc.
void ScDocument::KeyInput( const KeyEvent& )
2000-09-18 23:16:46 +00:00
{
if ( pChartListenerCollection->hasListeners() )
2000-09-18 23:16:46 +00:00
pChartListenerCollection->StartTimer();
if( apTemporaryChartLock.get() )
apTemporaryChartLock->StartOrContinueLocking();
2000-09-18 23:16:46 +00:00
}
// ----------------------------------------------------------------------------
2011-11-05 07:00:32 +01:00
bool ScDocument::CheckMacroWarn()
2000-09-18 23:16:46 +00:00
{
// The check for macro configuration, macro warning and disabling is now handled
// in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic.
2000-09-18 23:16:46 +00:00
2011-11-05 07:00:32 +01:00
return true;
2000-09-18 23:16:46 +00:00
}
2000-09-22 17:57:10 +00:00
//------------------------------------------------------------------------
SfxBindings* ScDocument::GetViewBindings()
{
// used to invalidate slots after changes to this document
if ( !pShell )
return NULL; // no ObjShell -> no view
// first check current view
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
if ( pViewFrame && pViewFrame->GetObjectShell() != pShell ) // wrong document?
pViewFrame = NULL;
// otherwise use first view for this doc
if ( !pViewFrame )
pViewFrame = SfxViewFrame::GetFirst( pShell );
if (pViewFrame)
return &pViewFrame->GetBindings();
else
return NULL;
}
2000-09-18 23:16:46 +00:00
ScDrawLayer* ScDocument::GetDrawLayer()
{
return pDrawLayer;
}
2001-03-26 18:26:30 +00:00
//------------------------------------------------------------------------
void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType )
{
OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" );
2001-03-26 18:26:30 +00:00
utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType );
2011-11-05 07:00:32 +01:00
bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
2001-03-26 18:26:30 +00:00
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
ScEditEngineDefaulter* pEngine = NULL; // not using pEditEngine member because of defaults
2001-03-27 12:48:15 +00:00
SCTAB nCount = GetTableCount();
2011-07-05 12:08:41 +01:00
ScMarkData::const_iterator itr = rMultiMark.begin(), itrEnd = rMultiMark.end();
for (; itr != itrEnd && *itr < nCount; ++itr)
if ( maTabs[*itr] )
2001-03-26 18:26:30 +00:00
{
SCTAB nTab = *itr;
SCCOL nCol = 0;
SCROW nRow = 0;
2001-03-26 18:26:30 +00:00
2011-11-05 07:00:32 +01:00
bool bFound = rMultiMark.IsCellMarked( nCol, nRow );
2001-03-26 18:26:30 +00:00
if (!bFound)
bFound = GetNextMarkedCell( nCol, nRow, nTab, rMultiMark );
while (bFound)
{
const ScBaseCell* pCell = GetCell( ScAddress( nCol, nRow, nTab ) );
CellType eType = pCell ? pCell->GetCellType() : CELLTYPE_NONE;
// fdo#32786 TITLE_CASE/SENTENCE_CASE need the extra handling in EditEngine (loop over words/sentences).
// Still use TransliterationWrapper directly for text cells with other transliteration types,
// for performance reasons.
if ( eType == CELLTYPE_EDIT ||
( eType == CELLTYPE_STRING && ( nType == com::sun::star::i18n::TransliterationModulesExtra::SENTENCE_CASE ||
nType == com::sun::star::i18n::TransliterationModulesExtra::TITLE_CASE ) ) )
2001-03-27 12:48:15 +00:00
{
if (!pEngine)
pEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool());
2001-03-27 12:48:15 +00:00
// defaults from cell attributes must be set so right language is used
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
SfxItemSet* pDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() );
pPattern->FillEditItemSet( pDefaults );
2011-11-05 07:00:32 +01:00
pEngine->SetDefaults( pDefaults, true );
2001-03-27 12:48:15 +00:00
if ( eType == CELLTYPE_STRING )
pEngine->SetText( static_cast<const ScStringCell*>(pCell)->GetString() );
else
{
const EditTextObject* pData = static_cast<const ScEditCell*>(pCell)->GetData();
pEngine->SetText( *pData );
}
2001-03-27 12:48:15 +00:00
pEngine->ClearModifyFlag();
sal_uInt16 nLastPar = pEngine->GetParagraphCount();
if (nLastPar)
--nLastPar;
xub_StrLen nTxtLen = pEngine->GetTextLen(nLastPar);
ESelection aSelAll( 0, 0, nLastPar, nTxtLen );
pEngine->TransliterateText( aSelAll, nType );
2001-03-27 12:48:15 +00:00
if ( pEngine->IsModified() )
{
ScEditAttrTester aTester( pEngine );
if ( aTester.NeedsObject() )
{
// remove defaults (paragraph attributes) before creating text object
SfxItemSet* pEmpty = new SfxItemSet( pEngine->GetEmptyItemSet() );
2011-11-05 07:00:32 +01:00
pEngine->SetDefaults( pEmpty, true );
2001-03-27 12:48:15 +00:00
EditTextObject* pNewData = pEngine->CreateTextObject();
PutCell( nCol, nRow, nTab,
new ScEditCell( pNewData, this, pEngine->GetEditTextObjectPool() ) );
delete pNewData;
}
else
{
rtl::OUString aNewStr = pEngine->GetText();
2001-03-27 12:48:15 +00:00
PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
}
}
2001-03-26 18:26:30 +00:00
}
else if ( eType == CELLTYPE_STRING )
{
2012-02-27 09:45:35 +00:00
rtl::OUString aOldStr = ((const ScStringCell*)pCell)->GetString();
sal_Int32 nOldLen = aOldStr.getLength();
if ( bConsiderLanguage )
{
sal_uInt8 nScript = GetStringScriptType( aOldStr ); //! cell script type?
sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE :
ATTR_FONT_LANGUAGE );
nLanguage = ((const SvxLanguageItem*)GetAttr( nCol, nRow, nTab, nWhich ))->GetValue();
}
com::sun::star::uno::Sequence<sal_Int32> aOffsets;
rtl::OUString aNewStr = aTranslitarationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
if ( aNewStr != aOldStr )
PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
}
2001-03-26 18:26:30 +00:00
bFound = GetNextMarkedCell( nCol, nRow, nTab, rMultiMark );
}
}
2001-03-27 12:48:15 +00:00
delete pEngine;
2001-03-26 18:26:30 +00:00
}
2000-09-18 23:16:46 +00:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */