summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx74
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx140
-rw-r--r--sc/source/ui/app/scmod2.cxx9
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx56
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx60
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx2
-rw-r--r--sc/source/ui/docshell/arealink.cxx14
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx17
-rw-r--r--sc/source/ui/docshell/docfunc.cxx101
-rw-r--r--sc/source/ui/docshell/docsh.cxx85
-rw-r--r--sc/source/ui/docshell/docsh3.cxx4
-rw-r--r--sc/source/ui/docshell/docsh4.cxx7
-rw-r--r--sc/source/ui/docshell/docsh5.cxx9
-rw-r--r--sc/source/ui/docshell/docsh8.cxx199
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx128
-rw-r--r--sc/source/ui/docshell/impex.cxx4
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx6
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx8
-rw-r--r--sc/source/ui/formdlg/privsplt.cxx18
-rw-r--r--sc/source/ui/inc/AccessibleDocumentPagePreview.hxx6
-rw-r--r--sc/source/ui/inc/AccessibleText.hxx4
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx1
-rw-r--r--sc/source/ui/inc/cellsh.hxx3
-rw-r--r--sc/source/ui/inc/csvtablebox.hxx10
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx13
-rw-r--r--sc/source/ui/inc/drawview.hxx2
-rw-r--r--sc/source/ui/inc/fieldwnd.hxx9
-rw-r--r--sc/source/ui/inc/gridwin.hxx57
-rw-r--r--sc/source/ui/inc/output.hxx2
-rw-r--r--sc/source/ui/inc/privsplt.hxx1
-rw-r--r--sc/source/ui/inc/refundo.hxx6
-rw-r--r--sc/source/ui/inc/tabview.hxx8
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/inc/undotab.hxx40
-rw-r--r--sc/source/ui/inc/viewfunc.hxx5
-rw-r--r--sc/source/ui/inc/viewutil.hxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx5
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx6
-rw-r--r--sc/source/ui/navipi/navipi.src2
-rw-r--r--sc/source/ui/pagedlg/pagedlg.src2
-rw-r--r--sc/source/ui/src/globstr.src14
-rw-r--r--sc/source/ui/src/hdrcont.src8
-rw-r--r--sc/source/ui/src/optdlg.src2
-rw-r--r--sc/source/ui/src/popup.src12
-rw-r--r--sc/source/ui/src/scfuncs.src42
-rw-r--r--sc/source/ui/undo/refundo.cxx21
-rw-r--r--sc/source/ui/undo/undoblk.cxx12
-rw-r--r--sc/source/ui/undo/undoblk3.cxx20
-rw-r--r--sc/source/ui/undo/undodat.cxx18
-rw-r--r--sc/source/ui/undo/undotab.cxx107
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx69
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx11
-rw-r--r--sc/source/ui/unoobj/docuno.cxx93
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx6
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx2
-rw-r--r--sc/source/ui/unoobj/servuno.cxx133
-rw-r--r--sc/source/ui/unoobj/textuno.cxx41
-rw-r--r--sc/source/ui/vba/makefile.mk7
-rw-r--r--sc/source/ui/view/cellsh.cxx19
-rw-r--r--sc/source/ui/view/cellsh1.cxx123
-rw-r--r--sc/source/ui/view/cellsh2.cxx16
-rw-r--r--sc/source/ui/view/drawview.cxx50
-rw-r--r--sc/source/ui/view/editsh.cxx6
-rw-r--r--sc/source/ui/view/formatsh.cxx5
-rw-r--r--sc/source/ui/view/gridwin.cxx389
-rw-r--r--sc/source/ui/view/gridwin2.cxx444
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/makefile.mk4
-rw-r--r--sc/source/ui/view/output.cxx14
-rw-r--r--sc/source/ui/view/output2.cxx27
-rw-r--r--sc/source/ui/view/tabcont.cxx4
-rw-r--r--sc/source/ui/view/tabview.cxx35
-rw-r--r--sc/source/ui/view/tabview3.cxx12
-rw-r--r--sc/source/ui/view/tabview5.cxx10
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx4
-rw-r--r--sc/source/ui/view/tabvwsha.cxx64
-rw-r--r--sc/source/ui/view/tabvwshb.cxx5
-rw-r--r--sc/source/ui/view/viewfun3.cxx382
-rw-r--r--sc/source/ui/view/viewfun4.cxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx9
-rw-r--r--sc/source/ui/view/viewutil.cxx34
88 files changed, 1641 insertions, 1778 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 4e36c8df0196..4dbc47524276 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -371,7 +371,7 @@ ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell)
::std::auto_ptr< SvxEditSource > ScAccessibleCell::CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos)
{
::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData
- (new ScAccessibleCellTextData(pViewShell, aCell, eSplitPos));
+ ( new ScAccessibleCellTextData( pViewShell, aCell, eSplitPos, this ) );
::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleCellTextData));
return pEditSource;
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 7d66c19cfb79..a81f359f04c7 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1906,40 +1906,40 @@ ScShapeChilds* ScAccessibleDocumentPagePreview::GetShapeChilds()
return mpShapeChilds;
}
-uno::Reference < XAccessible > ScAccessibleDocumentPagePreview::GetCurrentAccessibleTable()
-{
- if (!mpTable)
- {
- if ( mpViewShell )
- {
- const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
- ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
- //! order is background shapes, header, table or notes, footer, foreground shapes, controls
- sal_Int32 nIndex (aCount.nBackShapes + aCount.nHeaders);
-
- mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex );
- mpTable->acquire();
- mpTable->Init();
- }
- }
- return mpTable;
-}
-
-void ScAccessibleDocumentPagePreview::ChildCountChanged()
-{
- if (mpViewShell)
- {
- const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
- ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
- //! order is background shapes, header, table or notes, footer, foreground shapes, controls
- if(mpHeader)
- mpHeader->SetCurrentIndexInParent(aCount.nBackShapes);
- if (mpTable)
- mpTable->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders);
- if (mpFooter)
- mpFooter->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs);
-
- if (mpNotesChilds)
- mpNotesChilds->SetOffset(aCount.nBackShapes + aCount.nHeaders);
- }
-}
+//UNUSED2009-05 uno::Reference < XAccessible > ScAccessibleDocumentPagePreview::GetCurrentAccessibleTable()
+//UNUSED2009-05 {
+//UNUSED2009-05 if (!mpTable)
+//UNUSED2009-05 {
+//UNUSED2009-05 if ( mpViewShell )
+//UNUSED2009-05 {
+//UNUSED2009-05 const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
+//UNUSED2009-05 ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
+//UNUSED2009-05 //! order is background shapes, header, table or notes, footer, foreground shapes, controls
+//UNUSED2009-05 sal_Int32 nIndex (aCount.nBackShapes + aCount.nHeaders);
+//UNUSED2009-05
+//UNUSED2009-05 mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex );
+//UNUSED2009-05 mpTable->acquire();
+//UNUSED2009-05 mpTable->Init();
+//UNUSED2009-05 }
+//UNUSED2009-05 }
+//UNUSED2009-05 return mpTable;
+//UNUSED2009-05 }
+
+//UNUSED2009-05 void ScAccessibleDocumentPagePreview::ChildCountChanged()
+//UNUSED2009-05 {
+//UNUSED2009-05 if (mpViewShell)
+//UNUSED2009-05 {
+//UNUSED2009-05 const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
+//UNUSED2009-05 ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
+//UNUSED2009-05 //! order is background shapes, header, table or notes, footer, foreground shapes, controls
+//UNUSED2009-05 if(mpHeader)
+//UNUSED2009-05 mpHeader->SetCurrentIndexInParent(aCount.nBackShapes);
+//UNUSED2009-05 if (mpTable)
+//UNUSED2009-05 mpTable->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders);
+//UNUSED2009-05 if (mpFooter)
+//UNUSED2009-05 mpFooter->SetCurrentIndexInParent(aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs);
+//UNUSED2009-05
+//UNUSED2009-05 if (mpNotesChilds)
+//UNUSED2009-05 mpNotesChilds->SetOffset(aCount.nBackShapes + aCount.nHeaders);
+//UNUSED2009-05 }
+//UNUSED2009-05 }
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 18470475cebf..feeae8c73023 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -37,6 +37,7 @@
#include <memory>
#include "AccessibleText.hxx"
+#include "AccessibleCell.hxx"
#include "tabvwsh.hxx"
#include "editutil.hxx"
#include "document.hxx"
@@ -54,6 +55,7 @@
#include <svx/editobj.hxx>
#include <svx/adjitem.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/algitem.hxx>
// ============================================================================
@@ -753,13 +755,14 @@ void ScEditViewForwarder::SetInvalid()
// ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object
ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell,
- const ScAddress& rP, ScSplitPos eSplitPos)
+ const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell)
: ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
mpViewForwarder(NULL),
mpEditViewForwarder(NULL),
mpViewShell(pViewShell),
meSplitPos(eSplitPos),
- mbViewEditEngine(sal_False)
+ mbViewEditEngine(sal_False),
+ mpAccessibleCell( pAccCell )
{
}
@@ -792,7 +795,7 @@ void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
ScAccessibleTextData* ScAccessibleCellTextData::Clone() const
{
- return new ScAccessibleCellTextData(mpViewShell, aCellPos, meSplitPos);
+ return new ScAccessibleCellTextData( mpViewShell, aCellPos, meSplitPos, mpAccessibleCell );
}
void ScAccessibleCellTextData::GetCellText(const ScAddress& rCellPos, String& rText)
@@ -866,7 +869,8 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
if (!bHasForwarder)*/
ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
- if (pEditEngine && mpViewShell)
+ ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL );
+ if ( pDoc && pEditEngine && mpViewShell )
{
long nSizeX, nSizeY;
mpViewShell->GetViewData()->GetMergeSizePixel(
@@ -874,9 +878,39 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
Size aSize(nSizeX, nSizeY);
- Window* pWin = mpViewShell->GetWindowByPos(meSplitPos);
- if (pWin)
- aSize = pWin->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
+ // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
+ long nIndent = 0;
+ const SvxHorJustifyItem* pHorJustifyItem = static_cast< const SvxHorJustifyItem* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_HOR_JUSTIFY ) );
+ SvxCellHorJustify eHorJust = ( pHorJustifyItem ? static_cast< SvxCellHorJustify >( pHorJustifyItem->GetValue() ) : SVX_HOR_JUSTIFY_STANDARD );
+ if ( eHorJust == SVX_HOR_JUSTIFY_LEFT )
+ {
+ const SfxUInt16Item* pIndentItem = static_cast< const SfxUInt16Item* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_INDENT ) );
+ if ( pIndentItem )
+ {
+ nIndent = static_cast< long >( pIndentItem->GetValue() );
+ }
+ }
+
+ const SvxMarginItem* pMarginItem = static_cast< const SvxMarginItem* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_MARGIN ) );
+ ScViewData* pViewData = mpViewShell->GetViewData();
+ double nPPTX = ( pViewData ? pViewData->GetPPTX() : 0 );
+ double nPPTY = ( pViewData ? pViewData->GetPPTY() : 0 );
+ long nLeftM = ( pMarginItem ? static_cast< long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
+ long nTopM = ( pMarginItem ? static_cast< long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
+ long nRightM = ( pMarginItem ? static_cast< long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
+ long nBottomM = ( pMarginItem ? static_cast< long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 );
+ long nWidth = aSize.getWidth() - nLeftM - nRightM;
+ aSize.setWidth( nWidth );
+ aSize.setHeight( aSize.getHeight() - nTopM - nBottomM );
+
+ Window* pWin = mpViewShell->GetWindowByPos( meSplitPos );
+ if ( pWin )
+ {
+ aSize = pWin->PixelToLogic( aSize, pEditEngine->GetRefMapMode() );
+ }
/* #i19430# Gnopernicus reads text partly if it sticks out of the cell
boundaries. This leads to wrong results in cases where the cell text
@@ -888,20 +922,94 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
return the size of the complete text then, which is used to expand
the cell bounding box in ScAccessibleCell::GetBoundingBox()
(see sc/source/ui/Accessibility/AccessibleCell.cxx). */
- if (pDocShell && pDocShell->GetDocument())
+ const SfxInt32Item* pItem = static_cast< const SfxInt32Item* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) );
+ if( pItem && (pItem->GetValue() != 0) )
+ {
+ pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
+ long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
+ aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) );
+ }
+ else
{
- const SfxInt32Item* pItem = static_cast< const SfxInt32Item* >(
- pDocShell->GetDocument()->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) );
- if( pItem && (pItem->GetValue() != 0) )
+ // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
+ const SfxBoolItem* pLineBreakItem = static_cast< const SfxBoolItem* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_LINEBREAK ) );
+ bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() );
+ if ( !bLineBreak )
{
- pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
- long nTextWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
- aSize.setWidth( std::max( aSize.getWidth(), nTextWidth + 2 ) );
+ long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
+ aSize.setWidth( ::std::max( aSize.getWidth(), nTxtWidth ) );
}
}
- // #i70916# Text in spread sheet cells return the wrong extents
- pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
+ pEditEngine->SetPaperSize( aSize );
+
+ // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
+ if ( eHorJust == SVX_HOR_JUSTIFY_STANDARD && pDoc->HasValueData( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
+ {
+ pEditEngine->SetDefaultItem( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
+ }
+
+ Size aTextSize;
+ if ( pWin )
+ {
+ aTextSize = pWin->LogicToPixel( Size( pEditEngine->CalcTextWidth(), pEditEngine->GetTextHeight() ), pEditEngine->GetRefMapMode() );
+ }
+ long nTextWidth = aTextSize.Width();
+ long nTextHeight = aTextSize.Height();
+
+ long nOffsetX = nLeftM;
+ long nDiffX = nTextWidth - nWidth;
+ if ( nDiffX > 0 )
+ {
+ switch ( eHorJust )
+ {
+ case SVX_HOR_JUSTIFY_RIGHT:
+ {
+ nOffsetX -= nDiffX;
+ }
+ break;
+ case SVX_HOR_JUSTIFY_CENTER:
+ {
+ nOffsetX -= nDiffX / 2;
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+ }
+
+ long nOffsetY = 0;
+ const SvxVerJustifyItem* pVerJustifyItem = static_cast< const SvxVerJustifyItem* >(
+ pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) );
+ SvxCellVerJustify eVerJust = ( pVerJustifyItem ? static_cast< SvxCellVerJustify >( pVerJustifyItem->GetValue() ) : SVX_VER_JUSTIFY_STANDARD );
+ switch ( eVerJust )
+ {
+ case SVX_VER_JUSTIFY_STANDARD:
+ case SVX_VER_JUSTIFY_BOTTOM:
+ {
+ nOffsetY = nSizeY - nBottomM - nTextHeight;
+ }
+ break;
+ case SVX_VER_JUSTIFY_CENTER:
+ {
+ nOffsetY = ( nSizeY - nTopM - nBottomM - nTextHeight ) / 2 + nTopM;
+ }
+ break;
+ default:
+ {
+ nOffsetY = nTopM;
+ }
+ break;
+ }
+
+ if ( mpAccessibleCell )
+ {
+ mpAccessibleCell->SetOffset( Point( nOffsetX, nOffsetY ) );
+ }
pEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
}
diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx
index 2424b62c5414..4001ebe62036 100644
--- a/sc/source/ui/app/scmod2.cxx
+++ b/sc/source/ui/app/scmod2.cxx
@@ -37,7 +37,8 @@
#include <svx/unolingu.hxx>
#include <svtools/lingucfg.hxx>
-
+#include <i18npool/mslangid.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -62,9 +63,9 @@ void ScModule::GetSpellSettings( USHORT& rDefLang, USHORT& rCjkLang, USHORT& rCt
SvtLinguOptions aOptions;
aConfig.GetOptions( aOptions );
- rDefLang = aOptions.nDefaultLanguage;
- rCjkLang = aOptions.nDefaultLanguage_CJK;
- rCtlLang = aOptions.nDefaultLanguage_CTL;
+ rDefLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+ rCjkLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+ rCtlLang = MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
rAutoSpell = aOptions.bIsSpellAuto;
}
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 2c7691bd7188..c3cfb97cd52c 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -42,16 +42,16 @@
// ============================================================================
-ScCsvTableBox::ScCsvTableBox( Window* pParent ) :
- ScCsvControl( pParent, maData, WB_BORDER | WB_TABSTOP | WB_DIALOGCONTROL ),
- maRuler( *this ),
- maGrid( *this ),
- maHScroll( this, WB_HORZ | WB_DRAG ),
- maVScroll( this, WB_VERT | WB_DRAG ),
- maScrollBox( this )
-{
- Init();
-}
+//UNUSED2009-05 ScCsvTableBox::ScCsvTableBox( Window* pParent ) :
+//UNUSED2009-05 ScCsvControl( pParent, maData, WB_BORDER | WB_TABSTOP | WB_DIALOGCONTROL ),
+//UNUSED2009-05 maRuler( *this ),
+//UNUSED2009-05 maGrid( *this ),
+//UNUSED2009-05 maHScroll( this, WB_HORZ | WB_DRAG ),
+//UNUSED2009-05 maVScroll( this, WB_VERT | WB_DRAG ),
+//UNUSED2009-05 maScrollBox( this )
+//UNUSED2009-05 {
+//UNUSED2009-05 Init();
+//UNUSED2009-05 }
ScCsvTableBox::ScCsvTableBox( Window* pParent, const ResId& rResId ) :
ScCsvControl( pParent, maData, rResId ),
@@ -225,24 +225,24 @@ void ScCsvTableBox::SetUniStrings(
EnableRepaint();
}
-void ScCsvTableBox::SetByteStrings(
- const ByteString* pTextLines, CharSet eCharSet,
- const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep )
-{
- // assuming that pTextLines is a string array with size CSV_PREVIEW_LINES
- // -> will be dynamic sometime
- DisableRepaint();
- sal_Int32 nEndLine = GetFirstVisLine() + CSV_PREVIEW_LINES;
- const ByteString* pString = pTextLines;
- for( sal_Int32 nLine = GetFirstVisLine(); nLine < nEndLine; ++nLine, ++pString )
- {
- if( mbFixedMode )
- maGrid.ImplSetTextLineFix( nLine, String( *pString, eCharSet ) );
- else
- maGrid.ImplSetTextLineSep( nLine, String( *pString, eCharSet ), rSepChars, cTextSep, bMergeSep );
- }
- EnableRepaint();
-}
+//UNUSED2009-05 void ScCsvTableBox::SetByteStrings(
+//UNUSED2009-05 const ByteString* pTextLines, CharSet eCharSet,
+//UNUSED2009-05 const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep )
+//UNUSED2009-05 {
+//UNUSED2009-05 // assuming that pTextLines is a string array with size CSV_PREVIEW_LINES
+//UNUSED2009-05 // -> will be dynamic sometime
+//UNUSED2009-05 DisableRepaint();
+//UNUSED2009-05 sal_Int32 nEndLine = GetFirstVisLine() + CSV_PREVIEW_LINES;
+//UNUSED2009-05 const ByteString* pString = pTextLines;
+//UNUSED2009-05 for( sal_Int32 nLine = GetFirstVisLine(); nLine < nEndLine; ++nLine, ++pString )
+//UNUSED2009-05 {
+//UNUSED2009-05 if( mbFixedMode )
+//UNUSED2009-05 maGrid.ImplSetTextLineFix( nLine, String( *pString, eCharSet ) );
+//UNUSED2009-05 else
+//UNUSED2009-05 maGrid.ImplSetTextLineSep( nLine, String( *pString, eCharSet ), rSepChars, cTextSep, bMergeSep );
+//UNUSED2009-05 }
+//UNUSED2009-05 EnableRepaint();
+//UNUSED2009-05 }
// column settings ------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index e20542bfedf6..4d3c478d9068 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -31,12 +31,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
#include <vcl/virdev.hxx>
#include <vcl/decoview.hxx>
#include <vcl/svapp.hxx>
-
+#include <vcl/mnemonic.hxx>
+#include <vcl/help.hxx>
#include <tools/debug.hxx>
#include "fieldwnd.hxx"
@@ -44,10 +43,7 @@
#include "pvglob.hxx"
#include "AccessibleDataPilotControl.hxx"
#include "scresid.hxx"
-#ifndef SC_SC_HRC
#include "sc.hrc"
-#endif
-#include <vcl/mnemonic.hxx>
const size_t INVALID_INDEX = static_cast< size_t >( -1 );
@@ -238,27 +234,44 @@ void ScDPFieldWindow::DrawBackground( OutputDevice& rDev )
}
void ScDPFieldWindow::DrawField(
- OutputDevice& rDev, const Rectangle& rRect, const String& rText, bool bFocus )
+ OutputDevice& rDev, const Rectangle& rRect, FieldString& rText, bool bFocus )
{
VirtualDevice aVirDev( rDev );
// #i97623# VirtualDevice is always LTR while other windows derive direction from parent
aVirDev.EnableRTL( IsRTLEnabled() );
+ String aText = rText.first;
Size aDevSize( rRect.GetSize() );
long nWidth = aDevSize.Width();
long nHeight = aDevSize.Height();
- long nLabelWidth = rDev.GetTextWidth( rText );
+ long nLabelWidth = rDev.GetTextWidth( aText );
long nLabelHeight = rDev.GetTextHeight();
- Point aLabelPos(
- ((nWidth > nLabelWidth + 6) ? (nWidth - nLabelWidth) / 2 : 3),
- ((nHeight > nLabelHeight + 6) ? (nHeight - nLabelHeight) / 2 : 3) );
+
+ // #i31600# if text is too long, cut and add ellipsis
+ rText.second = nLabelWidth + 6 <= nWidth;
+ if( !rText.second )
+ {
+ xub_StrLen nMinLen = 0;
+ xub_StrLen nMaxLen = aText.Len();
+ bool bFits = false;
+ do
+ {
+ xub_StrLen nCurrLen = (nMinLen + nMaxLen) / 2;
+ aText = String( rText.first, 0, nCurrLen ).AppendAscii( "..." );
+ nLabelWidth = rDev.GetTextWidth( aText );
+ bFits = nLabelWidth + 6 <= nWidth;
+ (bFits ? nMinLen : nMaxLen) = nCurrLen;
+ }
+ while( !bFits || (nMinLen + 1 < nMaxLen) );
+ }
+ Point aLabelPos( (nWidth - nLabelWidth) / 2, ::std::max< long >( (nHeight - nLabelHeight) / 2, 3 ) );
aVirDev.SetOutputSizePixel( aDevSize );
aVirDev.SetFont( rDev.GetFont() );
DecorationView aDecoView( &aVirDev );
aDecoView.DrawButton( Rectangle( Point( 0, 0 ), aDevSize ), bFocus ? BUTTON_DRAW_DEFAULT : 0 );
aVirDev.SetTextColor( aTextColor );
- aVirDev.DrawText( aLabelPos, rText );
+ aVirDev.DrawText( aLabelPos, aText );
rDev.DrawBitmap( rRect.TopLeft(), aVirDev.GetBitmap( Point( 0, 0 ), aDevSize ) );
}
@@ -292,7 +305,7 @@ void ScDPFieldWindow::Redraw()
if( HasFocus() && (nFieldSelected < aFieldArr.size()) )
{
long nFieldWidth = aFieldRect.GetWidth();
- long nSelectionWidth = Min( GetTextWidth( aFieldArr[ nFieldSelected ] ) + 4, nFieldWidth - 6 );
+ long nSelectionWidth = Min( GetTextWidth( aFieldArr[ nFieldSelected ].first ) + 4, nFieldWidth - 6 );
Rectangle aSelection(
GetFieldPosition( nFieldSelected ) + Point( (nFieldWidth - nSelectionWidth) / 2, 3 ),
Size( nSelectionWidth, aFieldRect.GetHeight() - 6 ) );
@@ -320,6 +333,11 @@ bool ScDPFieldWindow::IsExistingIndex( size_t nIndex ) const
return nIndex < aFieldArr.size();
}
+bool ScDPFieldWindow::IsShortenedText( size_t nIndex ) const
+{
+ return (nIndex < aFieldArr.size()) && !aFieldArr[ nIndex ].second;
+}
+
size_t ScDPFieldWindow::CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const
{
size_t nNewField = nFieldSelected;
@@ -513,6 +531,14 @@ void __EXPORT ScDPFieldWindow::MouseMove( const MouseEvent& rMEvt )
PointerStyle ePtr = pDlg->NotifyMouseMove( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
SetPointer( Pointer( ePtr ) );
}
+ size_t nIndex = 0;
+ if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsShortenedText( nIndex ) )
+ {
+ Point aPos = OutputToScreenPixel( rMEvt.GetPosPixel() );
+ Rectangle aRect( aPos, GetSizePixel() );
+ String aHelpText = GetFieldText(nIndex);
+ Help::ShowQuickHelp( this, aRect, aHelpText );
+ }
}
void __EXPORT ScDPFieldWindow::KeyInput( const KeyEvent& rKEvt )
@@ -598,7 +624,7 @@ void ScDPFieldWindow::AddField( const String& rText, size_t nNewIndex )
DBG_ASSERT( nNewIndex == aFieldArr.size(), "ScDPFieldWindow::AddField - invalid index" );
if( IsValidIndex( nNewIndex ) )
{
- aFieldArr.push_back( rText );
+ aFieldArr.push_back( FieldString( rText, true ) );
if (pAccessible)
{
com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
@@ -646,7 +672,7 @@ void ScDPFieldWindow::SetFieldText( const String& rText, size_t nIndex )
{
if( IsExistingIndex( nIndex ) )
{
- aFieldArr[ nIndex ] = rText;
+ aFieldArr[ nIndex ] = FieldString( rText, true );
Redraw();
if (pAccessible)
@@ -663,7 +689,7 @@ void ScDPFieldWindow::SetFieldText( const String& rText, size_t nIndex )
const String& ScDPFieldWindow::GetFieldText( size_t nIndex ) const
{
if( IsExistingIndex( nIndex ) )
- return aFieldArr[ nIndex ];
+ return aFieldArr[ nIndex ].first;
return EMPTY_STRING;
}
@@ -680,7 +706,7 @@ bool ScDPFieldWindow::AddField( const String& rText, const Point& rPos, size_t&
if( nNewIndex > aFieldArr.size() )
nNewIndex = aFieldArr.size();
- aFieldArr.insert( aFieldArr.begin() + nNewIndex, rText );
+ aFieldArr.insert( aFieldArr.begin() + nNewIndex, FieldString( rText, true ) );
nFieldSelected = nNewIndex;
Redraw();
rnIndex = nNewIndex;
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 6bc96c13d5b6..773862088155 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -82,7 +82,7 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList )
xub_StrLen nCount = rList.GetTokenCount('\t');
for ( xub_StrLen i=0; i<nCount; i+=2 )
{
- if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )//CHINA001 if ( ScGlobal::pTransliteration->isEqual( aStr, rList.GetToken(i,'\t') ) )
+ if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )//CHINA001 if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.GetToken(i,'\t') ) )
c = (sal_Unicode)rList.GetToken(i+1,'\t').ToInt32();
}
if (!c && aStr.Len())
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index a290a81d9078..fd3a562ecb42 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -63,6 +63,7 @@
#include "sc.hrc" //CHINA001
#include "scabstdlg.hxx" //CHINA001
+#include "clipparam.hxx"
struct AreaLink_Impl
{
@@ -354,12 +355,12 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
}
else
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aOldRange, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
}
else // ohne Einfuegen
{
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aMaxRange, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
}
}
@@ -369,7 +370,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
if (bDoInsert)
pDoc->FitBlock( aOldRange, aNewRange ); // incl. loeschen
else
- pDoc->DeleteAreaTab( aMaxRange, IDF_ALL );
+ pDoc->DeleteAreaTab( aMaxRange, IDF_ALL & ~IDF_NOTE );
// Daten kopieren
@@ -389,9 +390,8 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
aSourceMark.SelectOneTable( nSrcTab ); // selektieren fuer CopyToClip
aSourceMark.SetMarkArea( aTokenRange );
- pSrcDoc->CopyToClip( aTokenRange.aStart.Col(), aTokenRange.aStart.Row(),
- aTokenRange.aEnd.Col(), aTokenRange.aEnd.Row(),
- FALSE, &aClipDoc, FALSE, &aSourceMark );
+ ScClipParam aClipParam(aTokenRange, false);
+ pSrcDoc->CopyToClip(aClipParam, &aClipDoc, &aSourceMark);
if ( aClipDoc.HasAttrib( 0,0,nSrcTab, MAXCOL,MAXROW,nSrcTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
@@ -426,7 +426,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
{
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab );
- pDoc->CopyToDocument( aNewRange, IDF_ALL, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, FALSE, pRedoDoc );
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoUpdateAreaLink( pImpl->m_pDocSh,
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index ae176868162e..09e4dd7aa4af 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -576,18 +576,21 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (bRecord)
{
+ // do not touch notes (ScUndoImportData does not support drawing undo)
+ sal_uInt16 nCopyFlags = IDF_ALL & ~IDF_NOTE;
+
// nFormulaCols is set only if column count is unchanged
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ nCopyFlags, FALSE, pUndoDoc );
if ( rParam.nCol2 > nEndCol )
pDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nUndoEndCol, nUndoEndRow, nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ nCopyFlags, FALSE, pUndoDoc );
if ( rParam.nRow2 > nEndRow )
pDoc->CopyToDocument( rParam.nCol1, nEndRow+1, nTab,
nUndoEndCol+nFormulaCols, nUndoEndRow, nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ nCopyFlags, FALSE, pUndoDoc );
}
//
@@ -601,7 +604,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
ScRange aDelRange( rParam.nCol1, rParam.nRow1, nTab,
rParam.nCol2, rParam.nRow2, nTab );
- pDoc->DeleteAreaTab( aDelRange, IDF_ALL ); // ohne die Formeln
+ pDoc->DeleteAreaTab( aDelRange, IDF_ALL & ~IDF_NOTE ); // ohne die Formeln
ScRange aOld( rParam.nCol1, rParam.nRow1, nTab,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
@@ -611,10 +614,10 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
- aNewMark, IDF_CONTENTS );
+ aNewMark, IDF_CONTENTS & ~IDF_NOTE );
// CopyToDocument doesn't remove contents
- pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS );
+ pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
// #41216# remove each column from ImportDoc after copying to reduce memory usage
BOOL bOldAutoCalc = pDoc->GetAutoCalc();
@@ -671,7 +674,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (nFormulaCols > 0) // include filled formulas for redo
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ALL, FALSE, pRedoDoc );
+ IDF_ALL & ~IDF_NOTE, FALSE, pRedoDoc );
ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : NULL;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index ebb080a89cfa..cb5d2ead509f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -94,6 +94,7 @@
#include "compiler.hxx"
#include "scui_def.hxx" //CHINA001
#include "tabprotection.hxx"
+#include "clipparam.hxx"
#include <memory>
@@ -113,6 +114,14 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
else
rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( pUndoAction, &rDocShell ) );
rDocShell.SetDrawModified();
+
+ // the affected sheet isn't known, so all stream positions are invalidated
+ ScDocument* pDoc = rDocShell.GetDocument();
+ SCTAB nTabCount = pDoc->GetTableCount();
+ for (SCTAB nTab=0; nTab<nTabCount; nTab++)
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
return 0;
}
@@ -1061,6 +1070,9 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
if( rDoc.IsUndoEnabled() )
rDocShell.GetUndoManager()->AddUndoAction( new ScUndoShowHideNote( rDocShell, rPos, bShow ) );
+ if (rDoc.IsStreamValid(rPos.Tab()))
+ rDoc.SetStreamValid(rPos.Tab(), FALSE);
+
rDocShell.SetDocumentModified();
return true;
@@ -1089,6 +1101,9 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, BOOL bA
//! Undo !!!
+ if (pDoc->IsStreamValid(rPos.Tab()))
+ pDoc->SetStreamValid(rPos.Tab(), FALSE);
+
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
@@ -1142,6 +1157,10 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
// repaint cell (to make note marker visible)
rDocShell.PostPaintCell( rPos );
+
+ if (rDoc.IsStreamValid(rPos.Tab()))
+ rDoc.SetStreamValid(rPos.Tab(), FALSE);
+
aModificator.SetDocumentModified();
bDone = true;
}
@@ -1997,7 +2016,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
nScenarioCount ++;
pDoc->CopyToDocument( nUndoStartX, nUndoStartY, i, nUndoEndX, nUndoEndY, i+nScenarioCount,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL | IDF_NOCAPTIONS, FALSE, pUndoDoc );
}
}
@@ -2258,8 +2277,8 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
}
ScDrawLayer::SetGlobalDrawPersist(aDragShellRef);
- pDoc->CopyToClip( nStartCol, nStartRow, nEndCol, nEndRow, bCut, pClipDoc,
- FALSE, &aSourceMark, bScenariosAdded, TRUE );
+ ScClipParam aClipParam(ScRange(nStartCol, nStartRow, 0, nEndCol, nEndRow, 0), bCut);
+ pDoc->CopyToClip(aClipParam, pClipDoc, &aSourceMark, false, bScenariosAdded, true);
ScDrawLayer::SetGlobalDrawPersist(NULL);
@@ -2766,42 +2785,42 @@ BOOL ScDocFunc::SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL /* bApi */ )
return TRUE;
}
-BOOL ScDocFunc::SetGrammar( formula::FormulaGrammar::Grammar eGrammar )
-{
- ScDocument* pDoc = rDocShell.GetDocument();
-
- if ( pDoc->GetGrammar() == eGrammar )
- return TRUE;
-
- BOOL bUndo(pDoc->IsUndoEnabled());
- ScDocShellModificator aModificator( rDocShell );
-
- pDoc->SetGrammar( eGrammar );
-
- if (bUndo)
- {
- rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSetGrammar( &rDocShell, eGrammar ) );
- }
-
- rDocShell.PostPaint( 0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_ALL );
-
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- if (NULL != pViewSh)
- {
- pViewSh->UpdateInputHandler( FALSE, FALSE );
- }
-
- aModificator.SetDocumentModified();
-
- SfxBindings* pBindings = rDocShell.GetViewBindings();
- if (pBindings)
- {
- // erAck: 2006-09-07T22:19+0200 commented out in CWS scr1c1
- //pBindings->Invalidate( FID_TAB_USE_R1C1 );
- }
-
- return TRUE;
-}
+//UNUSED2009-05 BOOL ScDocFunc::SetGrammar( formula::FormulaGrammar::Grammar eGrammar )
+//UNUSED2009-05 {
+//UNUSED2009-05 ScDocument* pDoc = rDocShell.GetDocument();
+//UNUSED2009-05
+//UNUSED2009-05 if ( pDoc->GetGrammar() == eGrammar )
+//UNUSED2009-05 return TRUE;
+//UNUSED2009-05
+//UNUSED2009-05 BOOL bUndo(pDoc->IsUndoEnabled());
+//UNUSED2009-05 ScDocShellModificator aModificator( rDocShell );
+//UNUSED2009-05
+//UNUSED2009-05 pDoc->SetGrammar( eGrammar );
+//UNUSED2009-05
+//UNUSED2009-05 if (bUndo)
+//UNUSED2009-05 {
+//UNUSED2009-05 rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSetGrammar( &rDocShell, eGrammar ) );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 rDocShell.PostPaint( 0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_ALL );
+//UNUSED2009-05
+//UNUSED2009-05 ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
+//UNUSED2009-05 if (NULL != pViewSh)
+//UNUSED2009-05 {
+//UNUSED2009-05 pViewSh->UpdateInputHandler( FALSE, FALSE );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 aModificator.SetDocumentModified();
+//UNUSED2009-05
+//UNUSED2009-05 SfxBindings* pBindings = rDocShell.GetViewBindings();
+//UNUSED2009-05 if (pBindings)
+//UNUSED2009-05 {
+//UNUSED2009-05 // erAck: 2006-09-07T22:19+0200 commented out in CWS scr1c1
+//UNUSED2009-05 //pBindings->Invalidate( FID_TAB_USE_R1C1 );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 return TRUE;
+//UNUSED2009-05 }
BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi )
{
@@ -3558,7 +3577,7 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
//! auch bei Undo selektierte Tabellen beruecksichtigen
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
}
// use TokenArray if given, string (and flags) otherwise
@@ -3646,7 +3665,7 @@ BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
//! auch bei Undo selektierte Tabellen beruecksichtigen
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTabOp( &rDocShell,
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index c62c2dc41fdf..f7d1e2ccae2f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -120,6 +120,7 @@
#include "cfgids.hxx"
#include "warnpassword.hxx"
#include "optsolver.hxx"
+#include "sheetdata.hxx"
#include "tabprotection.hxx"
#include "docsh.hxx"
@@ -755,8 +756,13 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( IsDocShared() && !SC_MOD()->IsInSharedDocSaving() )
{
}
+ UseSheetSaveEntries(); // use positions from saved file for next saving
}
break;
+ case SFX_EVENT_SAVEASDOCDONE:
+ // new positions are used after "save" and "save as", but not "save to"
+ UseSheetSaveEntries(); // use positions from saved file for next saving
+ break;
default:
{
}
@@ -1850,38 +1856,28 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed )
aDocument.SetExtDocOptions( pExtDocOpt = new ScExtDocOptions );
pViewShell->GetViewData()->WriteExtOptions( *pExtDocOpt );
-#if ENABLE_SHEET_PROTECTION
- bool bNeedRetypePassDlg = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_XL);
- if (bNeedRetypePassDlg && !pViewShell->ExecuteRetypePassDlg(PASSHASH_XL))
+ /* #115980# #i104990# If the imported document contains a medium
+ password, determine if we can save it, otherwise ask the users
+ whether they want to save without it. */
+ if( !::sfx2::CheckMSPasswordCapabilityForExport( aFltName ) )
{
- SetError( ERRCODE_ABORT );
- return false;
- }
-#else
-
- do
- {
- SfxItemSet* pSet = rMed.GetItemSet();
- if (!pSet)
- break;
-
- const SfxPoolItem* pItem = NULL;
- if (SFX_ITEM_SET != pSet->GetItemState(SID_PASSWORD, sal_True, &pItem))
- // password is not set.
- break;
-
- /* #115980 #If the imported document contained an encrypted password -
- determine if we should save without it. */
- bDoSave = ScWarnPassword::WarningOnPassword( rMed );
-
- if (bDoSave)
+ SfxItemSet* pItemSet = rMed.GetItemSet();
+ const SfxPoolItem* pItem = 0;
+ if( pItemSet && pItemSet->GetItemState( SID_PASSWORD, sal_True, &pItem ) == SFX_ITEM_SET )
{
- // #i42858# warn only one time
- pSet->ClearItem(SID_PASSWORD);
+ bDoSave = ScWarnPassword::WarningOnPassword( rMed );
+ // #i42858# remove password from medium (warn only one time)
+ if( bDoSave )
+ pItemSet->ClearItem( SID_PASSWORD );
}
}
- while (false);
+#if ENABLE_SHEET_PROTECTION
+ if( bDoSave )
+ {
+ bool bNeedRetypePassDlg = ScPassHashHelper::needsPassHashRegen( aDocument, PASSHASH_XL );
+ bDoSave = !bNeedRetypePassDlg || pViewShell->ExecuteRetypePassDlg( PASSHASH_XL );
+ }
#endif
}
@@ -2212,6 +2208,7 @@ BOOL ScDocShell::HasAutomaticTableName( const String& rFilter ) // static
pPaintLockData ( NULL ), \
pOldJobSetup ( NULL ), \
pSolverSaveData ( NULL ), \
+ pSheetSaveData ( NULL ), \
pModificator ( NULL )
//------------------------------------------------------------------
@@ -2305,6 +2302,7 @@ __EXPORT ScDocShell::~ScDocShell()
delete pOldJobSetup; // gesetzt nur bei Fehler in StartJob()
delete pSolverSaveData;
+ delete pSheetSaveData;
delete pOldAutoDBRange;
if (pModificator)
@@ -2475,6 +2473,39 @@ void ScDocShell::SetSolverSaveData( const ScOptSolverSave& rData )
pSolverSaveData = new ScOptSolverSave( rData );
}
+ScSheetSaveData* ScDocShell::GetSheetSaveData()
+{
+ if (!pSheetSaveData)
+ pSheetSaveData = new ScSheetSaveData;
+
+ return pSheetSaveData;
+}
+
+void ScDocShell::UseSheetSaveEntries()
+{
+ if (pSheetSaveData)
+ {
+ pSheetSaveData->UseSaveEntries(); // use positions from saved file for next saving
+
+ bool bHasEntries = false;
+ SCTAB nTabCount = aDocument.GetTableCount();
+ SCTAB nTab;
+ for (nTab = 0; nTab < nTabCount; ++nTab)
+ if (pSheetSaveData->HasStreamPos(nTab))
+ bHasEntries = true;
+
+ if (!bHasEntries)
+ {
+ // if no positions were set (for example, export to other format),
+ // reset all "valid" flags
+
+ for (nTab = 0; nTab < nTabCount; ++nTab)
+ if (aDocument.IsStreamValid(nTab))
+ aDocument.SetStreamValid(nTab, FALSE);
+ }
+ }
+}
+
// --- ScDocShellModificator ------------------------------------------
ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS )
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index fcbfb648ae14..380f4635cdcf 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -483,6 +483,10 @@ OutputDevice* ScDocShell::GetRefDevice()
USHORT ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags )
{
+ SfxPrinter *pOld = aDocument.GetPrinter( FALSE );
+ if ( pOld && pOld->IsPrinting() )
+ return SFX_PRINTERROR_BUSY;
+
if (nDiffFlags & SFX_PRINTER_PRINTER)
{
if ( aDocument.GetPrinter() != pNewPrinter )
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index d4df2863eec5..80b0c76a64be 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1300,6 +1300,13 @@ void ScDocShell::DoHardRecalc( BOOL /* bApi */ )
aDocument.BroadcastUno( SfxSimpleHint( SC_HINT_CALCALL ) );
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
+ // use hard recalc also to disable stream-copying of all sheets
+ // (somewhat consistent with charts)
+ SCTAB nTabCount = aDocument.GetTableCount();
+ for (SCTAB nTab=0; nTab<nTabCount; nTab++)
+ if (aDocument.IsStreamValid(nTab))
+ aDocument.SetStreamValid(nTab, FALSE);
+
PostPaintGridAll();
}
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 281f03ff3622..b7c726deeb71 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -406,6 +406,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
{
BOOL bIsUndoEnabled = aDocument.IsUndoEnabled();
aDocument.EnableUndo( FALSE );
+ aDocument.LockStreamValid( true ); // ignore draw page size (but not formula results)
if ( bBefore ) // check all sheets up to nUpdateTab
{
SCTAB nTabCount = aDocument.GetTableCount();
@@ -437,16 +438,10 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
aDocument.SetPendingRowHeights( nUpdateTab, FALSE );
}
}
+ aDocument.LockStreamValid( false );
aDocument.EnableUndo( bIsUndoEnabled );
}
-#if OLD_PIVOT_IMPLEMENTATION
-void ScDocShell::PivotUpdate( ScPivot*, ScPivot*, BOOL, BOOL )
-{
- DBG_ERRORFILE("PivotUpdate is obsolete!");
-}
-#endif
-
void ScDocShell::RefreshPivotTables( const ScRange& rSource )
{
//! rename to RefreshDataPilotTables?
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 149856b4aa6b..d58777b9b5d5 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -43,13 +43,14 @@
#include <ucbhelper/content.hxx>
#include <unotools/sharedunocomponent.hxx>
#include <comphelper/processfactory.hxx>
-#include <connectivity/dbcharset.hxx>
#include <svx/txenctab.hxx>
+#include <svx/dbcharsethelper.hxx>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDriver.hpp>
+#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/sdbc/XDriverManager.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
@@ -104,6 +105,61 @@ using namespace com::sun::star;
#define SC_ROWCOUNT_ERROR (-1)
+namespace
+{
+ ULONG lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager>& _rDrvMgr,uno::Reference<sdbc::XConnection>& _rConnection,String& _rTabName,const String& rFullFileName,rtl_TextEncoding eCharSet)
+ {
+ INetURLObject aURL;
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ aURL.SetSmartURL( rFullFileName );
+ _rTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true,
+ INetURLObject::DECODE_UNAMBIGUOUS );
+ String aExtension = aURL.getExtension();
+ aURL.removeSegment();
+ aURL.removeFinalSlash();
+ String aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
+ uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
+ if (!xFactory.is()) return SCERR_EXPORT_CONNECT;
+
+ _rDrvMgr.set( xFactory->createInstance(
+ rtl::OUString::createFromAscii( SC_SERVICE_DRVMAN ) ),
+ uno::UNO_QUERY);
+ DBG_ASSERT( _rDrvMgr.is(), "can't get DriverManager" );
+ if (!_rDrvMgr.is()) return SCERR_EXPORT_CONNECT;
+
+ // get connection
+
+ String aConnUrl = String::CreateFromAscii("sdbc:dbase:");
+ aConnUrl += aPath;
+
+ svxform::ODataAccessCharsetHelper aHelper;
+ ::std::vector< rtl_TextEncoding > aEncodings;
+ aHelper.getSupportedTextEncodings( aEncodings );
+ ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(),(rtl_TextEncoding) eCharSet);
+ if ( aIter == aEncodings.end() )
+ {
+ DBG_ERRORFILE( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" );
+ return SCERR_IMPORT_CONNECT;
+ } // if ( aIter == aMap.end() )
+ rtl::OUString aCharSetStr;
+ if ( RTL_TEXTENCODING_DONTKNOW != *aIter )
+ { // it's not the virtual "system charset"
+ const char* pIanaName = rtl_getMimeCharsetFromTextEncoding( *aIter );
+ OSL_ENSURE( pIanaName, "invalid mime name!" );
+ if ( pIanaName )
+ aCharSetStr = ::rtl::OUString::createFromAscii( pIanaName );
+ }
+
+ uno::Sequence<beans::PropertyValue> aProps(2);
+ aProps[0].Name = rtl::OUString::createFromAscii(SC_DBPROP_EXTENSION);
+ aProps[0].Value <<= rtl::OUString( aExtension );
+ aProps[1].Name = rtl::OUString::createFromAscii(SC_DBPROP_CHARSET);
+ aProps[1].Value <<= aCharSetStr;
+
+ _rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps );
+ return 0L;
+ }
+}
// -----------------------------------------------------------------------
// MoveFile/KillFile/IsDocument: similar to SfxContentHelper
@@ -201,48 +257,13 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
try
{
- INetURLObject aURL;
- aURL.SetSmartProtocol( INET_PROT_FILE );
- aURL.SetSmartURL( rFullFileName );
- String aTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true,
- INetURLObject::DECODE_UNAMBIGUOUS );
- String aExtension = aURL.getExtension();
- aURL.removeSegment();
- aURL.removeFinalSlash();
- String aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
-
- uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
- if (!xFactory.is())
- return ERRCODE_IO_GENERAL;
-
- uno::Reference<sdbc::XDriverManager> xDrvMan( xFactory->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_DRVMAN ) ),
- uno::UNO_QUERY);
- DBG_ASSERT( xDrvMan.is(), "can't get DriverManager" );
- if (!xDrvMan.is()) return SCERR_IMPORT_CONNECT;
-
- String aConnUrl = String::CreateFromAscii("sdbc:dbase:");
- aConnUrl += aPath;
-
- dbtools::OCharsetMap aMap;
- dbtools::OCharsetMap::CharsetIterator aIter = aMap.find( (rtl_TextEncoding) eCharSet );
- if ( aIter == aMap.end() )
- {
- DBG_ERRORFILE( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" );
- return SCERR_IMPORT_CONNECT;
- }
- rtl::OUString aCharSetStr = (*aIter).getIanaName();
-
- uno::Sequence<beans::PropertyValue> aProps(2);
- aProps[0].Name = rtl::OUString::createFromAscii(SC_DBPROP_EXTENSION);
- aProps[0].Value <<= rtl::OUString( aExtension );
- aProps[1].Name = rtl::OUString::createFromAscii(SC_DBPROP_CHARSET);
- aProps[1].Value <<= aCharSetStr;
-
- uno::Reference<sdbc::XConnection> xConnection =
- xDrvMan->getConnectionWithInfo( aConnUrl, aProps );
- DBG_ASSERT( xConnection.is(), "can't get Connection" );
- if (!xConnection.is()) return SCERR_IMPORT_CONNECT;
+ String aTabName;
+ uno::Reference<sdbc::XDriverManager> xDrvMan;
+ uno::Reference<sdbc::XConnection> xConnection;
+ ULONG nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
+ if ( !xConnection.is() || !xDrvMan.is() )
+ return nRet;
+ ::utl::DisposableComponent aConnectionHelper(xConnection);
long nRowCount = 0;
if ( nRowCount < 0 )
@@ -252,10 +273,11 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
}
ScProgress aProgress( this, ScGlobal::GetRscString( STR_LOAD_DOC ), nRowCount );
-
+ uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
uno::UNO_QUERY);
+ ::utl::DisposableComponent aRowSetHelper(xRowSet);
uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY );
DBG_ASSERT( xRowProp.is(), "can't get RowSet" );
if (!xRowProp.is()) return SCERR_IMPORT_CONNECT;
@@ -369,9 +391,6 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
if ( nRowCount )
aProgress.SetStateOnPercent( nRow );
}
-
- comphelper::disposeComponent( xRowSet );
- comphelper::disposeComponent( xConnection );
}
catch ( sdbc::SQLException& )
{
@@ -733,91 +752,29 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
aColNames.getArray(), aColTypes.getArray(),
aColLengths.getArray(), aColScales.getArray(),
bHasMemo, eCharSet );
-
- INetURLObject aURL;
- aURL.SetSmartProtocol( INET_PROT_FILE );
- aURL.SetSmartURL( rFullFileName );
- String aTabName = aURL.getBase( INetURLObject::LAST_SEGMENT, true,
- INetURLObject::DECODE_UNAMBIGUOUS );
- String aExtension = aURL.getExtension();
- aURL.removeSegment();
- aURL.removeFinalSlash();
- String aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
-
// also needed for exception catch
SCROW nDocRow = 0;
ScFieldEditEngine aEditEngine( aDocument.GetEditPool() );
String aString;
+ String aTabName;
try
{
- uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
- if (!xFactory.is()) return SCERR_EXPORT_CONNECT;
-
- uno::Reference<sdbc::XDriverManager> xDrvMan( xFactory->createInstance(
- rtl::OUString::createFromAscii( SC_SERVICE_DRVMAN ) ),
- uno::UNO_QUERY);
- DBG_ASSERT( xDrvMan.is(), "can't get DriverManager" );
- if (!xDrvMan.is()) return SCERR_EXPORT_CONNECT;
-
- // get connection
-
- String aConnUrl = String::CreateFromAscii("sdbc:dbase:");
- aConnUrl += aPath;
-
- dbtools::OCharsetMap aMap;
- dbtools::OCharsetMap::CharsetIterator aIter = aMap.find( (rtl_TextEncoding) eCharSet );
- if ( aIter == aMap.end() )
- {
- DBG_ERRORFILE( "DBaseExport: dbtools::OCharsetMap doesn't know text encoding" );
- return SCERR_EXPORT_CONNECT;
- }
- rtl::OUString aCharSetStr = (*aIter).getIanaName();
-
- uno::Sequence<beans::PropertyValue> aProps(2);
- aProps[0].Name = rtl::OUString::createFromAscii(SC_DBPROP_EXTENSION);
- aProps[0].Value <<= rtl::OUString( aExtension );
- aProps[1].Name = rtl::OUString::createFromAscii(SC_DBPROP_CHARSET);
- aProps[1].Value <<= aCharSetStr;
-
- uno::Reference<sdbc::XConnection> xConnection =
- xDrvMan->getConnectionWithInfo( aConnUrl, aProps );
- DBG_ASSERT( xConnection.is(), "can't get Connection" );
- if (!xConnection.is()) return SCERR_EXPORT_CONNECT;
+ uno::Reference<sdbc::XDriverManager> xDrvMan;
+ uno::Reference<sdbc::XConnection> xConnection;
+ ULONG nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
+ if ( !xConnection.is() || !xDrvMan.is() )
+ return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
// get dBase driver
-
- uno::Reference<sdbc::XDriver> xDriver;
- BOOL bDriverFound = FALSE;
-
- uno::Reference<container::XEnumerationAccess> xEnAcc( xDrvMan, uno::UNO_QUERY );
- DBG_ASSERT( xEnAcc.is(), "can't get DriverManager EnumerationAccess" );
- if (!xEnAcc.is()) return SCERR_EXPORT_CONNECT;
-
- uno::Reference<container::XEnumeration> xEnum = xEnAcc->createEnumeration();
- DBG_ASSERT( xEnum.is(), "can't get DriverManager Enumeration" );
- if (!xEnum.is()) return SCERR_EXPORT_CONNECT;
-
- while ( xEnum->hasMoreElements() && !bDriverFound )
- {
- uno::Any aElement = xEnum->nextElement();
- if ( aElement >>= xDriver )
- if ( xDriver.is() && xDriver->acceptsURL( aConnUrl ) )
- bDriverFound = TRUE;
- }
-
- DBG_ASSERT( bDriverFound, "can't get dBase driver" );
- if (!bDriverFound) return SCERR_EXPORT_CONNECT;
+ uno::Reference< sdbc::XDriverAccess> xAccess(xDrvMan,uno::UNO_QUERY);
+ uno::Reference< sdbcx::XDataDefinitionSupplier > xDDSup( xAccess->getDriverByURL( xConnection->getMetaData()->getURL() ), uno::UNO_QUERY );
+ if ( !xDDSup.is() )
+ return SCERR_EXPORT_CONNECT;
// create table
-
- uno::Reference<sdbcx::XDataDefinitionSupplier> xDDSup( xDriver, uno::UNO_QUERY );
- DBG_ASSERT( xDDSup.is(), "can't get XDataDefinitionSupplier" );
- if (!xDDSup.is()) return SCERR_EXPORT_CONNECT;
-
- uno::Reference<sdbcx::XTablesSupplier> xTablesSupp =
- xDDSup->getDataDefinitionByConnection( xConnection );
+ uno::Reference<sdbcx::XTablesSupplier> xTablesSupp =xDDSup->getDataDefinitionByConnection( xConnection );
DBG_ASSERT( xTablesSupp.is(), "can't get Data Definition" );
if (!xTablesSupp.is()) return SCERR_EXPORT_CONNECT;
@@ -893,7 +850,7 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
// if (!xConnection.is()) return SCERR_EXPORT_CONNECT;
// get row set for writing
-
+ uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<sdbc::XRowSet> xRowSet( xFactory->createInstance(
rtl::OUString::createFromAscii( SC_SERVICE_ROWSET ) ),
uno::UNO_QUERY);
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 9cc0b274028e..f74e8c519fb6 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -384,11 +384,6 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
return TokenArrayRef();
DocItem& rDoc = itrDoc->second;
- RangeArrayMap::const_iterator itrRange = rDoc.maRangeArrays.find(rRange);
- if (itrRange != rDoc.maRangeArrays.end())
- {
- return itrRange->second;
- }
TableNameIndexMap::iterator itrTabId = rDoc.maTableNameIndex.find(
ScGlobal::pCharClass->upper(rTabName));
@@ -410,6 +405,13 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
// not all tables are cached.
return TokenArrayRef();
+ ScRange aCacheRange( nCol1, nRow1, static_cast<SCTAB>(nTabFirstId), nCol2, nRow2, static_cast<SCTAB>(nTabLastId));
+ RangeArrayMap::const_iterator itrRange = rDoc.maRangeArrays.find( aCacheRange);
+ if (itrRange != rDoc.maRangeArrays.end())
+ {
+ return itrRange->second;
+ }
+
TokenArrayRef pArray(new ScTokenArray);
bool bFirstTab = true;
for (size_t nTab = nTabFirstId; nTab <= nTabLastId; ++nTab)
@@ -462,7 +464,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
bFirstTab = false;
}
- rDoc.maRangeArrays.insert(RangeArrayMap::value_type(rRange, pArray));
+ rDoc.maRangeArrays.insert( RangeArrayMap::value_type( aCacheRange, pArray));
return pArray;
}
@@ -545,13 +547,13 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
return;
}
- size_t nTab1 = itrTabName->second;
+ size_t nTabFirstId = itrTabName->second;
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
vector<SingleRangeData>::const_iterator itrDataBeg = rData.begin(), itrDataEnd = rData.end();
for (vector<SingleRangeData>::const_iterator itrData = itrDataBeg; itrData != itrDataEnd; ++itrData)
{
- size_t i = nTab1 + ::std::distance(itrDataBeg, itrData);
+ size_t i = nTabFirstId + ::std::distance(itrDataBeg, itrData);
TableTypeRef& pTabData = rDoc.maTables[i];
if (!pTabData.get())
pTabData.reset(new Table);
@@ -575,7 +577,9 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
}
}
- rDoc.maRangeArrays.insert(RangeArrayMap::value_type(rRange, pArray));
+ size_t nTabLastId = nTabFirstId + rRange.aEnd.Tab() - rRange.aStart.Tab();
+ ScRange aCacheRange( nCol1, nRow1, static_cast<SCTAB>(nTabFirstId), nCol2, nRow2, static_cast<SCTAB>(nTabLastId));
+ rDoc.maRangeArrays.insert( RangeArrayMap::value_type( aCacheRange, pArray));
}
bool ScExternalRefCache::isDocInitialized(sal_uInt16 nFileId)
@@ -950,9 +954,18 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex)
{
+ // In API, the index is transported as cached sheet ID of type sal_Int32 in
+ // sheet::SingleReference.Sheet or sheet::ComplexReference.Reference1.Sheet
+ // in a sheet::FormulaToken, choose a sensible value for N/A. Effectively
+ // being 0xffffffff
+ const size_t nNotAvailable = static_cast<size_t>( static_cast<sal_Int32>( -1));
+
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
+ {
+ if (pnIndex) *pnIndex = nNotAvailable;
return TableTypeRef();
+ }
DocItem& rDoc = *pDoc;
@@ -966,7 +979,10 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
}
if (!bCreateNew)
+ {
+ if (pnIndex) *pnIndex = nNotAvailable;
return TableTypeRef();
+ }
// Specified table doesn't exist yet. Create one.
nIndex = rDoc.maTables.size();
@@ -1045,7 +1061,7 @@ void ScExternalRefLink::DataChanged(const String& /*rMimeType*/, const Any& /*rV
else
{
// The source document has changed.
- pMgr->switchSrcFile(mnFileId, aFile);
+ pMgr->switchSrcFile(mnFileId, aFile, aFilter);
maFilterName = aFilter;
}
}
@@ -1891,24 +1907,17 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
if (!pFileData)
return NULL;
+ // Always load the document by using the path created from the relative
+ // path. If the referenced document is not there, simply exit. The
+ // original file name should be used only when the relative path is not
+ // given.
String aFile = pFileData->maFileName;
- if (!isFileLoadable(aFile))
- {
- // The original file path is not loadable. Try the relative path.
- // Note that the path is relative to the content.xml substream which
- // is one-level higher than the file itself.
+ maybeCreateRealFileName(nFileId);
+ if (pFileData->maRealFileName.Len())
+ aFile = pFileData->maRealFileName;
- if (!pFileData->maRelativeName.Len())
- return NULL;
-
- INetURLObject aBaseURL(getOwnDocumentName());
- aBaseURL.insertName(OUString::createFromAscii("content.xml"));
- bool bWasAbs = false;
- aFile = aBaseURL.smartRel2Abs(pFileData->maRelativeName, bWasAbs).GetMainURL(INetURLObject::NO_DECODE);
- if (!isFileLoadable(aFile))
- // Ok, I've tried both paths but no success. Bail out.
- return NULL;
- }
+ if (!isFileLoadable(aFile))
+ return NULL;
String aOptions;
ScDocumentLoader::GetFilterName(aFile, rFilter, aOptions, true, false);
@@ -1960,6 +1969,9 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
bool ScExternalRefManager::isFileLoadable(const String& rFile) const
{
+ if (!rFile.Len())
+ return false;
+
if (isOwnDocument(rFile))
return false;
@@ -1994,6 +2006,32 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
maLinkedDocs.insert(LinkedDocMap::value_type(nFileId, true));
}
+void ScExternalRefManager::SrcFileData::maybeCreateRealFileName(const String& rOwnDocName)
+{
+ if (!maRelativeName.Len())
+ // No relative path given. Nothing to do.
+ return;
+
+ if (maRealFileName.Len())
+ // Real file name already created. Nothing to do.
+ return;
+
+ // Formulate the absolute file path from the relative path.
+ const String& rRelPath = maRelativeName;
+ INetURLObject aBaseURL(rOwnDocName);
+ aBaseURL.insertName(OUString::createFromAscii("content.xml"));
+ bool bWasAbs = false;
+ maRealFileName = aBaseURL.smartRel2Abs(rRelPath, bWasAbs).GetMainURL(INetURLObject::NO_DECODE);
+}
+
+void ScExternalRefManager::maybeCreateRealFileName(sal_uInt16 nFileId)
+{
+ if (nFileId >= maSrcFiles.size())
+ return;
+
+ maSrcFiles[nFileId].maybeCreateRealFileName(getOwnDocumentName());
+}
+
bool ScExternalRefManager::compileTokensByCell(const ScAddress& rCell)
{
ScBaseCell* pCell;
@@ -2064,12 +2102,20 @@ sal_uInt16 ScExternalRefManager::getExternalFileId(const String& rFile)
return static_cast<sal_uInt16>(maSrcFiles.size() - 1);
}
-const String* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId) const
+const String* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal)
{
if (nFileId >= maSrcFiles.size())
return NULL;
- return &maSrcFiles[nFileId].maFileName;
+ if (bForceOriginal)
+ return &maSrcFiles[nFileId].maFileName;
+
+ maybeCreateRealFileName(nFileId);
+
+ if (maSrcFiles[nFileId].maRealFileName.Len())
+ return &maSrcFiles[nFileId].maRealFileName;
+ else
+ return &maSrcFiles[nFileId].maFileName;
}
bool ScExternalRefManager::hasExternalFile(sal_uInt16 nFileId) const
@@ -2138,10 +2184,17 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId)
notifyAllLinkListeners(nFileId, LINK_BROKEN);
}
-void ScExternalRefManager::switchSrcFile(sal_uInt16 nFileId, const String& rNewFile)
+void ScExternalRefManager::switchSrcFile(sal_uInt16 nFileId, const String& rNewFile, const String& rNewFilter)
{
maSrcFiles[nFileId].maFileName = rNewFile;
maSrcFiles[nFileId].maRelativeName.Erase();
+ maSrcFiles[nFileId].maRealFileName.Erase();
+ if (!maSrcFiles[nFileId].maFilterName.Equals(rNewFilter))
+ {
+ // Filter type has changed.
+ maSrcFiles[nFileId].maFilterName = rNewFilter;
+ maSrcFiles[nFileId].maFilterOptions.Erase();
+ }
refreshNames(nFileId);
}
@@ -2175,19 +2228,18 @@ bool ScExternalRefManager::hasExternalData() const
return !maSrcFiles.empty();
}
-void ScExternalRefManager::resetSrcFileData()
+void ScExternalRefManager::resetSrcFileData(const String& rBaseFileUrl)
{
- INetURLObject aBaseURL(getOwnDocumentName());
- aBaseURL.insertName(OUString::createFromAscii("content.xml"));
- String aBaseUrlStr = aBaseURL.GetMainURL(INetURLObject::NO_DECODE);
for (vector<SrcFileData>::iterator itr = maSrcFiles.begin(), itrEnd = maSrcFiles.end();
itr != itrEnd; ++itr)
{
- if (!itr->maRelativeName.Len())
- {
- itr->maRelativeName = URIHelper::simpleNormalizedMakeRelative(
- aBaseUrlStr, itr->maFileName);
- }
+ // Re-generate relative file name from the absolute file name.
+ String aAbsName = itr->maRealFileName;
+ if (!aAbsName.Len())
+ aAbsName = itr->maFileName;
+
+ itr->maRelativeName = URIHelper::simpleNormalizedMakeRelative(
+ rBaseFileUrl, aAbsName);
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 67186f84a84a..1561e4c6efeb 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -253,7 +253,7 @@ BOOL ScImportExport::StartPaste()
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pUndoDoc );
}
return TRUE;
}
@@ -270,7 +270,7 @@ void ScImportExport::EndPaste()
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pRedoDoc );
ScMarkData aDestMark;
aDestMark.SelectOneTable( aRange.aStart.Tab() );
pDocSh->GetUndoManager()->AddUndoAction(
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 9f7c201c8aca..570d41f7885d 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -280,7 +280,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
{
String aName;
pDoc->GetName( nTab, aName );
- if ( ScGlobal::pTransliteration->isEqual(
+ if ( ScGlobal::GetpTransliteration()->isEqual(
ScGlobal::GetDocTabName( aFileName, aTabName ), aName ) )
{
pDoc->RenameTab( nTab,
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 8c175f0cd3a9..d241843f9745 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -201,7 +201,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
}
break;
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
ExecutePasteContents( rReq );
break;
@@ -467,7 +467,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( FID_PASTE_CONTENTS );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
@@ -502,7 +502,7 @@ void __EXPORT ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
switch (nWhich)
{
case SID_PASTE:
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
if( !bPastePossible )
rSet.DisableItem( nWhich );
break;
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index a011de6fa0e9..d05e0568c1ca 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -91,7 +91,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
break;
case SID_PASTE:
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
case SID_CLIPBOARD_FORMAT_ITEMS:
case SID_HYPERLINK_SETLINK:
{
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 701a53aecfcc..2152abfd4f8b 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -110,6 +110,9 @@ void FuText::StopEditMode(BOOL /*bTextDirection*/)
}
}
+ if( pNote )
+ rDoc.LockStreamValid(true); // only the affected sheet is invalidated below
+
/* SdrObjEditView::SdrEndTextEdit() may try to delete the entire drawing
object, if it does not contain text and has invisible border and fill.
This must not happen for note caption objects. They will be removed
@@ -183,6 +186,11 @@ void FuText::StopEditMode(BOOL /*bTextDirection*/)
pAction->SetComment( ScGlobal::GetRscString( bNewNote ? STR_UNDO_INSERTNOTE : STR_UNDO_DELETENOTE ) );
}
}
+
+ // invalidate stream positions only for the affected sheet
+ rDoc.LockStreamValid(false);
+ if (rDoc.IsStreamValid(aNotePos.Tab()))
+ rDoc.SetStreamValid(aNotePos.Tab(), FALSE);
}
}
diff --git a/sc/source/ui/formdlg/privsplt.cxx b/sc/source/ui/formdlg/privsplt.cxx
index 2ea9636691d7..c6eedbc5f06e 100644
--- a/sc/source/ui/formdlg/privsplt.cxx
+++ b/sc/source/ui/formdlg/privsplt.cxx
@@ -232,24 +232,6 @@ void ScPrivatSplit::MouseMove( const MouseEvent& rMEvt )
}
/*************************************************************************
-#* Member: SetXRange Datum:14.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: ScPrivatSplit
-#*
-#* Funktion: Setzt den Range fuer die X- Verschiebung
-#*
-#* Input: neuer Bereich
-#*
-#* Output: ---
-#*
-#************************************************************************/
-void ScPrivatSplit::SetXRange(Range cRgeX)
-{
- aXMovingRange=cRgeX;
-}
-
-/*************************************************************************
#* Member: SetYRange Datum:14.10.97
#*------------------------------------------------------------------------
#*
diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
index ba1b10dc4ccd..af871def7b65 100644
--- a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
+++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx
@@ -116,10 +116,10 @@ public:
///===== internal ========================================================
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible >
- GetCurrentAccessibleTable();
+//UNUSED2009-05 com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible >
+//UNUSED2009-05 GetCurrentAccessibleTable();
- void ChildCountChanged();
+//UNUSED2009-05 void ChildCountChanged();
protected:
/// Return this object's description.
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index 63e263a12f8a..a1138e869d3b 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -46,6 +46,7 @@ class ScEditViewForwarder;
class ScPreviewShell;
class EditTextObject;
class ScCsvViewForwarder;
+class ScAccessibleCell;
// ============================================================================
@@ -103,7 +104,7 @@ class ScAccessibleCellTextData : public ScAccessibleCellBaseTextData
{
public:
ScAccessibleCellTextData(ScTabViewShell* pViewShell,
- const ScAddress& rP, ScSplitPos eSplitPos);
+ const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell);
virtual ~ScAccessibleCellTextData();
virtual ScAccessibleTextData* Clone() const;
@@ -123,6 +124,7 @@ private:
ScTabViewShell* mpViewShell;
ScSplitPos meSplitPos;
sal_Bool mbViewEditEngine;
+ ScAccessibleCell* mpAccessibleCell;
// prevent the using of this method of the base class
ScSharedCellEditSource* GetOriginalSource() { return NULL; }
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 74621d3ced41..9e2d833b27d0 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -128,7 +128,6 @@ private:
protected:
virtual BOOL DoClose( USHORT nId );
- void EnableSpreadsheets( BOOL bFlag = TRUE, BOOL bChilds = TRUE );
void SetDispatcherLock( BOOL bLock );
virtual long PreNotify( NotifyEvent& rNEvt );
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 8e09b7350bb1..90adbe40d2d2 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -42,6 +42,7 @@ class SvxClipboardFmtItem;
class TransferableDataHelper;
class TransferableClipboardListener;
class AbstractScLinkedAreaDlg;
+class ScTabViewShell;
struct CellShell_Impl
{
@@ -101,6 +102,8 @@ public:
void ExecutePageSel( SfxRequest& rReq );
void ExecuteMove( SfxRequest& rReq );
void GetStateCursor( SfxItemSet& rSet );
+
+ static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, bool bShowDialog );
};
#endif
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index 544ec0aaecee..6e9c6b379ca9 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -77,7 +77,7 @@ private:
// ------------------------------------------------------------------------
public:
- explicit ScCsvTableBox( Window* pParent );
+//UNUSED2009-05 explicit ScCsvTableBox( Window* pParent );
explicit ScCsvTableBox( Window* pParent, const ResId& rResId );
// common table box handling ----------------------------------------------
@@ -112,10 +112,10 @@ public:
void SetUniStrings(
const String* pTextLines, const String& rSepChars,
sal_Unicode cTextSep, bool bMergeSep );
- /** Fills all cells of all lines with the passed texts (ByteStrings). */
- void SetByteStrings(
- const ByteString* pLineTexts, CharSet eCharSet,
- const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
+//UNUSED2009-05 /** Fills all cells of all lines with the passed texts (ByteStrings). */
+//UNUSED2009-05 void SetByteStrings(
+//UNUSED2009-05 const ByteString* pLineTexts, CharSet eCharSet,
+//UNUSED2009-05 const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
// column settings --------------------------------------------------------
public:
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 21e295a58fa4..3e9ff5258682 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -124,7 +124,7 @@ public:
BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi );
- BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar );
+//UNUSED2009-05 BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar );
SC_DLLPUBLIC BOOL SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges,
SCTAB nTab, ScSizeMode eMode, USHORT nSizeTwips,
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index b8b8d10f0c6e..9556b4ad8138 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -59,9 +59,6 @@ class INetURLObject;
class ScPaintItem;
class ScViewData;
class ScDocFunc;
-#if OLD_PIVOT_IMPLEMENTATION
-class ScPivot;
-#endif
class ScDrawLayer;
class ScTabViewShell;
class ScSbxDocHelper;
@@ -75,6 +72,7 @@ class VirtualDevice;
class ScImportOptions;
class ScDocShellModificator;
class ScOptSolverSave;
+class ScSheetSaveData;
namespace sfx2 { class FileDialogHelper; }
struct DocShell_Impl;
@@ -126,6 +124,7 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
ScPaintLockData* pPaintLockData;
ScJobSetup* pOldJobSetup;
ScOptSolverSave* pSolverSaveData;
+ ScSheetSaveData* pSheetSaveData;
ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
@@ -170,6 +169,8 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
SC_DLLPRIVATE void EnableSharedSettings( bool bEnable );
SC_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > LoadSharedDocument();
+ SC_DLLPRIVATE void UseSheetSaveEntries();
+
protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -293,10 +294,6 @@ public:
void UpdateAllRowHeights( const ScMarkData* pTabMark = NULL );
void UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false );
-#if OLD_PIVOT_IMPLEMENTATION
- void PivotUpdate( ScPivot* pOldPivot, ScPivot* pNewPivot,
- BOOL bRecord = TRUE, BOOL bApi = FALSE );
-#endif
void RefreshPivotTables( const ScRange& rSource );
void DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord = TRUE );
void UseScenario( SCTAB nTab, const String& rName, BOOL bRecord = TRUE );
@@ -421,6 +418,8 @@ public:
const ScOptSolverSave* GetSolverSaveData() const { return pSolverSaveData; } // may be null
void SetSolverSaveData( const ScOptSolverSave& rData );
+
+ ScSheetSaveData* GetSheetSaveData();
};
SO2_DECL_REF(ScDocShell)
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 33d0f4adf95d..1890bb1247c4 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -143,7 +143,7 @@ public:
inline void UnlockInternalLayer() { LockInternalLayer( false ); }
SdrEndTextEditKind ScEndTextEdit(); // ruft SetDrawTextUndo(0)
- void CaptionTextDirection(USHORT nSlot);
+//UNUSED2009-05 void CaptionTextDirection(USHORT nSlot);
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
};
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 5b24b5fea3df..ae2dbf1ffb52 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -68,12 +68,14 @@ enum ScDPFieldType
class ScDPFieldWindow : public Control
{
private:
+ typedef ::std::pair< String, bool > FieldString; // true = text fits into button
+
String aName; /// name of the control, used in Accessibility
ScDPLayoutDlg* pDlg; /// Parent dialog.
Rectangle aWndRect; /// Area rectangle in pixels.
FixedText* pFtCaption; /// FixedText containing the name of the control.
Point aTextPos; /// Position of the caption text.
- std::vector< String > aFieldArr; /// Pointer to string array of the field names.
+ std::vector< FieldString > aFieldArr; /// String array of the field names and flags, if text fits into button.
ScDPFieldType eType; /// Type of this area.
Color aFaceColor; /// Color for dialog background.
Color aWinColor; /// Color for window background.
@@ -97,13 +99,16 @@ private:
void DrawField(
OutputDevice& rDev,
const Rectangle& rRect,
- const String& rText,
+ FieldString& rText,
bool bFocus );
/** @return TRUE, if the field index is inside of the control area. */
bool IsValidIndex( size_t nIndex ) const;
/** @return TRUE, if the field with the given index exists. */
bool IsExistingIndex( size_t nIndex ) const;
+ /** @return TRUE, if the field with the given index exists and the text is
+ too long for the button control. */
+ bool IsShortenedText( size_t nIndex ) const;
/** @return The new selection index after moving to the given direction. */
size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 844d88055578..8b680daad6cb 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -37,6 +37,7 @@
#include "viewdata.hxx"
#include "cbutton.hxx"
#include <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
#include <vector>
@@ -44,9 +45,6 @@
struct ScTableInfo;
class ScViewSelectionEngine;
-#if OLD_PIVOT_IMPLEMENTATION
-class ScPivot;
-#endif
class ScDPObject;
class ScOutputData;
class ScFilterListBox;
@@ -97,44 +95,7 @@ public:
// ---------------------------------------------------------------------------
// predefines
-class ScGridWindow;
-
-enum ScOverlayType { SC_OVERLAY_INVERT, SC_OVERLAY_SOLID, SC_OVERLAY_BORDER_TRANSPARENT };
-
-// #114409#
-namespace sdr
-{
- namespace overlay
- {
- // predefines
- class OverlayObjectList;
-
- // OverlayObjectCell - used for cell cursor, selection and AutoFill handle
-
- class OverlayObjectCell : public OverlayObject
- {
- public:
- typedef ::std::vector< basegfx::B2DRange > RangeVector;
-
- protected:
- basegfx::B2DPolyPolygon impGetOverlayPolyPolygon() const;
-
- private:
- ScOverlayType mePaintType;
- RangeVector maRectangles;
-
- // geometry creation for OverlayObject
- virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
-
- public:
- OverlayObjectCell( ScOverlayType eType, const Color& rColor, const RangeVector& rRects);
- virtual ~OverlayObjectCell();
- };
-
- } // end of namespace overlay
-} // end of namespace sdr
-
-// ---------------------------------------------------------------------------
+namespace sdr { namespace overlay { class OverlayObjectList; }}
class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHelper
{
@@ -170,14 +131,6 @@ private:
BYTE nMouseStatus;
BYTE nNestedButtonState; // track nested button up/down calls
-#if OLD_PIVOT_IMPLEMENTATION
- BOOL bPivotMouse; // Pivot-D&D (alte Pivottabellen)
- ScPivot* pDragPivot;
- BOOL bPivotColField;
- SCCOL nPivotCol;
- SCCOL nPivotField;
-#endif
-
BOOL bDPMouse; // DataPilot-D&D (neue Pivottabellen)
long nDPField;
ScDPObject* pDragDPObj; //! name?
@@ -235,12 +188,6 @@ private:
BOOL DoPageFieldSelection( SCCOL nCol, SCROW nRow );
void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt );
-#if OLD_PIVOT_IMPLEMENTATION
- void PivotMouseMove( const MouseEvent& rMEvt );
- void PivotMouseButtonUp( const MouseEvent& rMEvt );
- BOOL PivotTestMouse( const MouseEvent& rMEvt, BOOL bMove );
- void DoPivotDrop( BOOL bDelete, BOOL bToCols, SCSIZE nDestPos );
-#endif
void DPMouseMove( const MouseEvent& rMEvt );
void DPMouseButtonUp( const MouseEvent& rMEvt );
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index da70a3465dc6..80da3d20982e 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -244,7 +244,9 @@ public:
void FindChanged();
void SetPagebreakMode( ScPageBreakData* pPageData );
+#ifdef OLD_SELECTION_PAINT
void DrawMark( Window* pWin );
+#endif
void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
SCCOL nRefEndX, SCROW nRefEndY,
const Color& rColor, BOOL bHandle );
diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx
index b8277a46c4f7..d3b7c9ad96b8 100644
--- a/sc/source/ui/inc/privsplt.hxx
+++ b/sc/source/ui/inc/privsplt.hxx
@@ -73,7 +73,6 @@ class ScPrivatSplit : public Control
virtual void CtrModified();
- void SetXRange(Range cRgeX);
void SetYRange(Range cRgeY);
void MoveSplitTo(Point aPos);
diff --git a/sc/source/ui/inc/refundo.hxx b/sc/source/ui/inc/refundo.hxx
index a796fcd611de..f3250e708b4c 100644
--- a/sc/source/ui/inc/refundo.hxx
+++ b/sc/source/ui/inc/refundo.hxx
@@ -37,9 +37,6 @@ class ScDocument;
class ScDBCollection;
class ScRangeName;
class ScPrintRangeSaver;
-#if OLD_PIVOT_IMPLEMENTATION
-class ScPivotCollection;
-#endif
class ScDPCollection;
class ScChartCollection;
class ScConditionalFormatList;
@@ -54,9 +51,6 @@ private:
ScDBCollection* pDBCollection;
ScRangeName* pRangeName;
ScPrintRangeSaver* pPrintRanges;
-#if OLD_PIVOT_IMPLEMENTATION
- ScPivotCollection* pPivotCollection;
-#endif
ScDPCollection* pDPCollection;
ScConditionalFormatList* pCondFormList;
ScDetOpList* pDetOpList;
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index d7b5e2a8260b..fe5da618e895 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -181,9 +181,6 @@ private:
BOOL bMoveIsShift;
BOOL bNewStartIfMarking;
- BOOL bOldSelection; // old style (inverting) of selection
-
-
void Init();
void DoAddWin( ScGridWindow* pWin );
@@ -227,7 +224,7 @@ protected:
public:
ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
- ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell );
+//UNUSED2009-05 ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell );
~ScTabView();
void MakeDrawLayer();
@@ -528,9 +525,6 @@ public:
void SetBrushDocument( ScDocument* pNew, BOOL bLock );
void SetDrawBrushSet( SfxItemSet* pNew, BOOL bLock );
void ResetBrushDocument();
-
- void UpdateSelectionType();
- BOOL IsOldSelection() const { return bOldSelection; }
};
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 10224536bf0b..eede290aa8db 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -418,7 +418,7 @@ public:
void ExecuteCellFormatDlg ( SfxRequest& rReq, USHORT nTabPage = 0xffff );
- BOOL GetFunction( String& rFuncStr );
+ BOOL GetFunction( String& rFuncStr, sal_uInt16 nErrCode = 0 );
void StartSimpleRefDialog( const String& rTitle, const String& rInitVal,
BOOL bCloseOnButtonUp, BOOL bSingleCell, BOOL bMultiSelection );
diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx
index 1eadf24041db..a7cf0d094d6b 100644
--- a/sc/source/ui/inc/undotab.hxx
+++ b/sc/source/ui/inc/undotab.hxx
@@ -493,26 +493,26 @@ private:
};
-class ScUndoSetGrammar : public ScSimpleUndo
-{
-public:
- TYPEINFO();
- ScUndoSetGrammar( ScDocShell* pShell,
- formula::FormulaGrammar::Grammar eGrammar );
- virtual ~ScUndoSetGrammar();
-
- virtual void Undo();
- virtual void Redo();
- virtual void Repeat(SfxRepeatTarget& rTarget);
- virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
-
- virtual String GetComment() const;
-
-private:
- formula::FormulaGrammar::Grammar meNewGrammar, meOldGrammar;
-
- void DoChange( formula::FormulaGrammar::Grammar eGrammar );
-};
+//UNUSED2009-05 class ScUndoSetGrammar : public ScSimpleUndo
+//UNUSED2009-05 {
+//UNUSED2009-05 public:
+//UNUSED2009-05 TYPEINFO();
+//UNUSED2009-05 ScUndoSetGrammar( ScDocShell* pShell,
+//UNUSED2009-05 formula::FormulaGrammar::Grammar eGrammar );
+//UNUSED2009-05 virtual ~ScUndoSetGrammar();
+//UNUSED2009-05
+//UNUSED2009-05 virtual void Undo();
+//UNUSED2009-05 virtual void Redo();
+//UNUSED2009-05 virtual void Repeat(SfxRepeatTarget& rTarget);
+//UNUSED2009-05 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
+//UNUSED2009-05
+//UNUSED2009-05 virtual String GetComment() const;
+//UNUSED2009-05
+//UNUSED2009-05 private:
+//UNUSED2009-05 formula::FormulaGrammar::Grammar meNewGrammar, meOldGrammar;
+//UNUSED2009-05
+//UNUSED2009-05 void DoChange( formula::FormulaGrammar::Grammar eGrammar );
+//UNUSED2009-05 };
#endif
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 228c4b4c1489..066aadca817a 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -348,6 +348,11 @@ private:
void PasteRTF( SCCOL nCol, SCROW nStartRow,
const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+ bool PasteMultiRangesFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+ bool bSkipEmpty, bool bTranspos, bool bAsLink, bool bAllowDialogs,
+ InsCellCmd eMoveMode, sal_uInt16 nCondFlags, sal_uInt16 nUndoFlags );
+ void PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark);
+
USHORT GetOptimalColWidth( SCCOL nCol, SCTAB nTab, BOOL bFormula );
void StartFormatArea();
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index bfc24e36b464..e7e4e27f233c 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -106,8 +106,10 @@ public:
ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
BOOL GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
+#ifdef OLD_SELECTION_PAINT
BOOL GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, BOOL& rCont );
void GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
+#endif
};
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 2faf148e5ac1..76330036b1f5 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -2127,7 +2127,7 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
nLeftKind == SV_ITEM_ID_LBOXSTRING )
{
- eCompare= (StringCompare) ScGlobal::pCaseCollator->compareString(
+ eCompare= (StringCompare) ScGlobal::GetCaseCollator()->compareString(
((SvLBoxString*)pLeftItem)->GetText(),
((SvLBoxString*)pRightItem)->GetText());
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 874236075d9f..befabb51a17c 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -826,11 +826,6 @@ BOOL __EXPORT ScAnyRefDlg::DoClose( USHORT nId )
return TRUE;
}
-void ScAnyRefDlg::EnableSpreadsheets(BOOL bFlag, BOOL bChilds)
-{
- m_aHelper.EnableSpreadsheets(bFlag, bChilds);
-}
-
void ScAnyRefDlg::SetDispatcherLock( BOOL bLock )
{
m_aHelper.SetDispatcherLock( bLock );
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 5f38fbf5c049..08dbd00de0f9 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -66,7 +66,7 @@ struct ScSolverOptionsEntry
bool operator< (const ScSolverOptionsEntry& rOther) const
{
- return ( ScGlobal::pCollator->compareString( aDescription, rOther.aDescription ) == COMPARE_LESS );
+ return ( ScGlobal::GetCollator()->compareString( aDescription, rOther.aDescription ) == COMPARE_LESS );
}
};
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index a2db7e4e48f0..af3b5f0dee5e 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -71,6 +71,7 @@
#include "navicfg.hxx"
#include "navsett.hxx"
#include "postit.hxx"
+#include "clipparam.hxx"
using namespace com::sun::star;
@@ -1103,9 +1104,8 @@ void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, USHORT nFlag
aMark ) )
{
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
- pSrcDoc->CopyToClip( rRange.aStart.Col(), rRange.aStart.Row(),
- rRange.aEnd.Col(), rRange.aEnd.Row(),
- FALSE, pClipDoc, FALSE, &aMark );
+ ScClipParam aClipParam(rRange, false);
+ pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark);
// pClipDoc->ExtendMerge( rRange, TRUE );
TransferableObjectDescriptor aObjDesc;
diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src
index f5eaeb56bae1..6d5baba4d075 100644
--- a/sc/source/ui/navipi/navipi.src
+++ b/sc/source/ui/navipi/navipi.src
@@ -320,7 +320,7 @@ String SCSTR_CONTENT_OLEOBJECT
};
String SCSTR_CONTENT_NOTE
{
- Text [ en-US ] = "Notes" ;
+ Text [ en-US ] = "Comments" ;
};
String SCSTR_CONTENT_AREALINK
{
diff --git a/sc/source/ui/pagedlg/pagedlg.src b/sc/source/ui/pagedlg/pagedlg.src
index a031fbe464c9..6db6b1c06cc7 100644
--- a/sc/source/ui/pagedlg/pagedlg.src
+++ b/sc/source/ui/pagedlg/pagedlg.src
@@ -175,7 +175,7 @@ TabPage RID_SCPAGE_TABLE
{
Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Notes" ;
+ Text [ en-US ] = "~Comments" ;
TabStop = TRUE ;
};
CheckBox BTN_OBJECTS
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index c5b8cfd1a9e8..fb3890616aa0 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -304,23 +304,23 @@ Resource RID_GLOBSTR
};
String STR_UNDO_INSERTNOTE
{
- Text [ en-US ] = "Insert Note" ;
+ Text [ en-US ] = "Insert Comment" ;
};
String STR_UNDO_DELETENOTE
{
- Text [ en-US ] = "Delete Note" ;
+ Text [ en-US ] = "Delete Comment" ;
};
String STR_UNDO_SHOWNOTE
{
- Text [ en-US ] = "Show Note" ;
+ Text [ en-US ] = "Show Comment" ;
};
String STR_UNDO_HIDENOTE
{
- Text [ en-US ] = "Hide note" ;
+ Text [ en-US ] = "Hide Comment" ;
};
String STR_UNDO_EDITNOTE
{
- Text [ en-US ] = "Edit Note" ;
+ Text [ en-US ] = "Edit Comment" ;
};
String STR_UNDO_DEC_INDENT
{
@@ -1020,7 +1020,7 @@ Resource RID_GLOBSTR
};
String STR_NOTES
{
- Text [ en-US ] = "Notes" ;
+ Text [ en-US ] = "Comments" ;
};
String STR_QUERY_DELTAB
{
@@ -1260,7 +1260,7 @@ Resource RID_GLOBSTR
};
String STR_SCATTR_PAGE_NOTES
{
- Text [ en-US ] = "Notes" ;
+ Text [ en-US ] = "Comments" ;
};
String STR_SCATTR_PAGE_GRID
{
diff --git a/sc/source/ui/src/hdrcont.src b/sc/source/ui/src/hdrcont.src
index 6b80e2597b87..7ba7b6a1c8fe 100644
--- a/sc/source/ui/src/hdrcont.src
+++ b/sc/source/ui/src/hdrcont.src
@@ -136,8 +136,8 @@ Menu RID_POPUP_ROWHEADER
PART2
MenuItem
{
- Identifier = FID_PASTE_CONTENTS ;
- HelpId = FID_PASTE_CONTENTS ;
+ Identifier = SID_PASTE_SPECIAL ;
+ HelpId = SID_PASTE_SPECIAL ;
Text [ en-US ] = "P~aste Special..." ;
};
};
@@ -214,8 +214,8 @@ Menu RID_POPUP_COLHEADER
PART2
MenuItem
{
- Identifier = FID_PASTE_CONTENTS ;
- HelpId = FID_PASTE_CONTENTS ;
+ Identifier = SID_PASTE_SPECIAL ;
+ HelpId = SID_PASTE_SPECIAL ;
Text [ en-US ] = "Paste ~Special..." ;
};
};
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index ed84da38b742..66e42d08dcef 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -363,7 +363,7 @@ TabPage RID_SCPAGE_CONTENT
{
Pos = MAP_APPFONT ( 139 , 40 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
- Text [ en-US ] = "~Note indicator" ;
+ Text [ en-US ] = "~Comment indicator" ;
};
CheckBox CB_VALUE
{
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index 05d10b9813bd..b03c0c0ae135 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -86,19 +86,19 @@ Menu RID_POPUP_CELLS
{
Identifier = SID_INSERT_POSTIT ;
HelpId = SID_INSERT_POSTIT ;
- Text [ en-US ] = "Insert ~Note" ;
+ Text [ en-US ] = "Insert Co~mment" ;
};
MenuItem
{
Identifier = SID_DELETE_NOTE ;
HelpId = SID_DELETE_NOTE ;
- Text [ en-US ] = "D~elete Note" ;
+ Text [ en-US ] = "D~elete Comment" ;
};
MenuItem
{
Identifier = FID_NOTE_VISIBLE ;
HelpId = FID_NOTE_VISIBLE ;
- Text [ en-US ] = "Sho~w Note" ;
+ Text [ en-US ] = "Sho~w Comment" ;
};
//------------------------------
MenuItem { Separator = TRUE ; };
@@ -126,8 +126,8 @@ Menu RID_POPUP_CELLS
MenuItem
{
- Identifier = FID_PASTE_CONTENTS ;
- HelpId = FID_PASTE_CONTENTS ;
+ Identifier = SID_PASTE_SPECIAL ;
+ HelpId = SID_PASTE_SPECIAL ;
Text [ en-US ] = "P~aste Special..." ;
};
//------------------------------
@@ -524,7 +524,7 @@ Menu RID_POPUP_PAGEBREAK
{
Identifier = FID_NOTE_VISIBLE ;
HelpId = FID_NOTE_VISIBLE ;
- Text [ en-US ] = "Sho~w Note" ;
+ Text [ en-US ] = "Sho~w Comment" ;
};
};
};
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index ed6273e26ae4..f05793872d4c 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -2691,7 +2691,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
{
String 1 // Description
{
- Text [ en-US ] = "Raises a number to the power of another." ;
+ Text [ en-US ] = "Returns a^b, base a raised to the power of exponent b." ;
};
ExtraData =
{
@@ -2707,15 +2707,15 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
};
String 3 // Description of Parameter 1
{
- Text [ en-US ] = "The number that is to be raised to the power of another." ;
+ Text [ en-US ] = "The base a of the power a^b." ;
};
String 4 // Name of Parameter 2
{
- Text [ en-US ] = "Power" ;
+ Text [ en-US ] = "Exponent" ;
};
String 5 // Description of Parameter 2
{
- Text [ en-US ] = "The power by which the number is to be raised." ;
+ Text [ en-US ] = "The exponent b of the power a^b." ;
};
};
// -=*# Resource for function ANZAHLLEEREZELLEN #*=-
@@ -5718,7 +5718,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
0;
ID_FUNCTION_GRP_STATISTIC;
U2S( HID_FUNC_NORMVERT );
- 4; 0; 0; 0; 0;
+ 4; 0; 0; 0; 1;
0;
};
String 2 // Name of Parameter 1
@@ -5731,7 +5731,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 4 // Name of Parameter 2
{
- Text [ en-US ] = "mean" ;
+ Text [ en-US ] = "Mean" ;
};
String 5 // Description of Parameter 2
{
@@ -5751,7 +5751,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 9 // Description of Parameter 4
{
- Text [ en-US ] = "Cumulated. C=0 calculates the density function, C=1 the distribution." ;
+ Text [ en-US ] = "0 or FALSE calculates the probability density function. Any other value or TRUE or omitted calculates the cumulative distribution function." ;
};
};
// -=*# Resource for function NORMINV #*=-
@@ -5854,7 +5854,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
0;
ID_FUNCTION_GRP_STATISTIC;
U2S( HID_FUNC_LOGNORMVERT );
- 3; 0; 0; 0;
+ 4; 0; 1; 1; 1;
0;
};
String 2 // Name of Parameter 1
@@ -5871,7 +5871,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 5 // Description of Parameter 2
{
- Text [ en-US ] = "Mean value. The mean value of the log normal distribution." ;
+ Text [ en-US ] = "The mean value of the log normal distribution. It is set to 0 if omitted." ;
};
String 6 // Name of Parameter 3
{
@@ -5879,7 +5879,15 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 7 // Description of Parameter 3
{
- Text [ en-US ] = "Standard deviation. The standard deviation of the log normal distribution." ;
+ Text [ en-US ] = "The standard deviation of the log normal distribution. It is set to 1 if omitted." ;
+ };
+ String 8 // Name of Parameter 4
+ {
+ Text [ en-US] = "Cumulative";
+ };
+ String 9 // Description of Parameter 4
+ {
+ Text [ en-US] = "0 or FALSE calculates the probability density function. Any other value or TRUE or omitted calculates the cumulative distribution function." ;
};
};
// -=*# Resource for function LOGINV #*=-
@@ -6758,7 +6766,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
{
String 1 // Description
{
- Text [ en-US ] = "Returns the two-tailed P value of a z test." ;
+ Text [ en-US ] = "Calculates the probability of observing a z-statistic greater than the one computed based on a sample." ;
};
ExtraData =
{
@@ -6774,15 +6782,15 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 3 // Description of Parameter 1
{
- Text [ en-US ] = "The data array." ;
+ Text [ en-US ] = "The given sample, drawn from a normally distributed population." ;
};
String 4 // Name of Parameter 2
{
- Text [ en-US ] = "Number" ;
+ Text [ en-US ] = "mu" ;
};
String 5 // Description of Parameter 2
{
- Text [ en-US ] = "The value to be tested." ;
+ Text [ en-US ] = "The known mean of the population." ;
};
String 6 // Name of Parameter 3
{
@@ -6790,7 +6798,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 7 // Description of Parameter 3
{
- Text [ en-US ] = "The standard deviation of the population." ;
+ Text [ en-US ] = "The known standard deviation of the population. If omitted, the standard deviation of the given sample is used." ;
};
};
// -=*# Resource for function CHITEST #*=-
@@ -8906,7 +8914,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
ExtraData =
{
- 1; // TODO: implementation and unsuppress
+ 0;
ID_FUNCTION_GRP_TEXT;
U2S( HID_FUNC_UNICODE );
1; 0;
@@ -8929,7 +8937,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
ExtraData =
{
- 1; // TODO: implementation and unsuppress
+ 0;
ID_FUNCTION_GRP_TEXT;
U2S( HID_FUNC_UNICHAR );
1; 0;
diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx
index 85bf65179bd8..8c72da7e7e25 100644
--- a/sc/source/ui/undo/refundo.cxx
+++ b/sc/source/ui/undo/refundo.cxx
@@ -66,10 +66,6 @@ ScRefUndoData::ScRefUndoData( const ScDocument* pDoc ) :
pPrintRanges = pDoc->CreatePrintRangeSaver(); // neu erzeugt
-#if OLD_PIVOT_IMPLEMENTATION
- ScPivotCollection* pOldPivot = pDoc->GetPivotCollection();
- pPivotCollection = pOldPivot ? new ScPivotCollection(*pOldPivot) : NULL;
-#endif
//! bei Pivot nur Bereiche merken ???
ScDPCollection* pOldDP = ((ScDocument*)pDoc)->GetDPCollection(); //! const
@@ -96,9 +92,6 @@ ScRefUndoData::~ScRefUndoData()
delete pDBCollection;
delete pRangeName;
delete pPrintRanges;
-#if OLD_PIVOT_IMPLEMENTATION
- delete pPivotCollection;
-#endif
delete pDPCollection;
delete pCondFormList;
delete pDetOpList;
@@ -130,15 +123,6 @@ void ScRefUndoData::DeleteUnchanged( const ScDocument* pDoc )
delete pNewRanges;
}
-#if OLD_PIVOT_IMPLEMENTATION
- if (pPivotCollection)
- {
- ScPivotCollection* pNewPivot = pDoc->GetPivotCollection();
- if ( pNewPivot && *pPivotCollection == *pNewPivot )
- DELETEZ(pPivotCollection);
- }
-#endif
-
if (pDPCollection)
{
ScDPCollection* pNewDP = ((ScDocument*)pDoc)->GetDPCollection(); //! const
@@ -195,11 +179,6 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, BOOL bUndoRefFirst )
if (pPrintRanges)
pDoc->RestorePrintRanges(*pPrintRanges);
-#if OLD_PIVOT_IMPLEMENTATION
- if (pPivotCollection)
- pDoc->SetPivotCollection( new ScPivotCollection(*pPivotCollection) );
-#endif
-
if (pDPCollection)
{
ScDPCollection* pDocDP = pDoc->GetDPCollection();
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index e44f5e7a6478..8cc45d41a2e6 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -64,6 +64,7 @@
#include "transobj.hxx"
#include "refundo.hxx"
#include "undoolk.hxx"
+#include "clipparam.hxx"
#include "sc.hrc"
@@ -441,7 +442,7 @@ void ScUndoDeleteCells::DoChange( const BOOL bUndo )
for( i=0; i<nCount && bUndo; i++ )
{
pRefUndoDoc->CopyToDocument( aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
- IDF_ALL, FALSE, pDoc );
+ IDF_ALL | IDF_NOCAPTIONS, FALSE, pDoc );
}
ScRange aWorkRange( aEffRange );
@@ -1316,9 +1317,8 @@ void __EXPORT ScUndoDragDrop::Redo()
aSourceMark.SelectTable( nTab, TRUE );
// do not clone objects and note captions into clipdoc (see above)
- pDoc->CopyToClip( aSrcRange.aStart.Col(), aSrcRange.aStart.Row(),
- aSrcRange.aEnd.Col(), aSrcRange.aEnd.Row(),
- bCut, pClipDoc, FALSE, &aSourceMark, bKeepScenarioFlags, FALSE, FALSE );
+ ScClipParam aClipParam(aSrcRange, bCut);
+ pDoc->CopyToClip(aClipParam, pClipDoc, &aSourceMark, false, bKeepScenarioFlags, false, false);
if (bCut)
{
@@ -1729,8 +1729,8 @@ void __EXPORT ScUndoEnterMatrix::Undo()
ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( aBlockRange, IDF_ALL );
- pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aBlockRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
pDocShell->PostPaint( aBlockRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index ea1e303d6ae3..4a94827ed1ec 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1340,8 +1340,8 @@ void __EXPORT ScUndoTabOp::Undo()
pDocShell->UpdatePaintExt( nExtFlags, aRange );
ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( aRange,IDF_ALL );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aRange,IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
pDocShell->PostPaint( aRange, PAINT_GRID, nExtFlags );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -2023,14 +2023,14 @@ void ScUndoUpdateAreaLink::DoChange( const BOOL bUndo ) const
if ( bWithInsert )
{
pDoc->FitBlock( aNewRange, aOldRange );
- pDoc->DeleteAreaTab( aOldRange, IDF_ALL );
- pUndoDoc->UndoToDocument( aOldRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aOldRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->UndoToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
- pDoc->DeleteAreaTab( aCopyRange, IDF_ALL );
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
}
}
else
@@ -2038,14 +2038,14 @@ void ScUndoUpdateAreaLink::DoChange( const BOOL bUndo ) const
if ( bWithInsert )
{
pDoc->FitBlock( aOldRange, aNewRange );
- pDoc->DeleteAreaTab( aNewRange, IDF_ALL );
- pRedoDoc->CopyToDocument( aNewRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aNewRange, IDF_ALL & ~IDF_NOTE );
+ pRedoDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
- pDoc->DeleteAreaTab( aCopyRange, IDF_ALL );
- pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL, FALSE, pDoc );
+ pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
+ pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
}
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index f16409b37239..7ab321ac0c1d 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1302,8 +1302,8 @@ void __EXPORT ScUndoImportData::Undo()
for (SCCOL nCopyCol = nCol1; nCopyCol <= nCol2; nCopyCol++)
{
pDoc->CopyToDocument( nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab,
- IDF_CONTENTS, FALSE, pRedoDoc );
- pDoc->DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, IDF_CONTENTS );
+ IDF_CONTENTS & ~IDF_NOTE, FALSE, pRedoDoc );
+ pDoc->DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, IDF_CONTENTS & ~IDF_NOTE );
pDoc->DoColResize( nTab, nCopyCol, nCopyCol, 0 );
}
pDoc->SetAutoCalc( bOldAutoCalc );
@@ -1321,7 +1321,7 @@ void __EXPORT ScUndoImportData::Undo()
pRedoDBData->GetArea( aNew );
pDoc->DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
- aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL );
+ aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL & ~IDF_NOTE );
aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock auch fuer Formeln
aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
@@ -1329,11 +1329,11 @@ void __EXPORT ScUndoImportData::Undo()
}
else
pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
- nEndCol,nEndRow, nTab, IDF_ALL );
+ nEndCol,nEndRow, nTab, IDF_ALL & ~IDF_NOTE );
pUndoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
nEndCol+nFormulaCols,nEndRow,nTab,
- IDF_ALL, FALSE, pDoc );
+ IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
if (pCurrentData)
{
@@ -1395,16 +1395,16 @@ void __EXPORT ScUndoImportData::Redo()
pDoc->FitBlock( aOld, aNew );
pDoc->DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
- aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL );
+ aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aNew, IDF_ALL, FALSE, pDoc ); // incl. Formeln
+ pRedoDoc->CopyToDocument( aNew, IDF_ALL & ~IDF_NOTE, FALSE, pDoc ); // incl. Formeln
}
else
{
pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
- nEndCol,nEndRow, nTab, IDF_ALL );
+ nEndCol,nEndRow, nTab, IDF_ALL & ~IDF_NOTE );
pRedoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
- nEndCol,nEndRow,nTab, IDF_ALL, FALSE, pDoc );
+ nEndCol,nEndRow,nTab, IDF_ALL & ~IDF_NOTE, FALSE, pDoc );
}
if (pCurrentData)
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index abd6f815abf9..ce428311d3f8 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -92,7 +92,7 @@ TYPEINIT1(ScUndoPrintRange, SfxUndoAction);
TYPEINIT1(ScUndoScenarioFlags, SfxUndoAction);
TYPEINIT1(ScUndoRenameObject, SfxUndoAction);
TYPEINIT1(ScUndoLayoutRTL, SfxUndoAction);
-TYPEINIT1(ScUndoSetGrammar, SfxUndoAction);
+//UNUSED2009-05 TYPEINIT1(ScUndoSetGrammar, SfxUndoAction);
// -----------------------------------------------------------------------
@@ -1611,59 +1611,54 @@ String ScUndoLayoutRTL::GetComment() const
// Set the grammar used for the sheet
//
-ScUndoSetGrammar::ScUndoSetGrammar( ScDocShell* pShell,
- formula::FormulaGrammar::Grammar eGrammar ) :
- ScSimpleUndo( pShell ),
- meNewGrammar( eGrammar )
-{
- meOldGrammar = pDocShell->GetDocument()->GetGrammar();
-}
-
-ScUndoSetGrammar::~ScUndoSetGrammar()
-{
-}
-
-void ScUndoSetGrammar::DoChange( formula::FormulaGrammar::Grammar eGrammar )
-{
- pDocShell->SetInUndo( TRUE );
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->SetGrammar( eGrammar );
- pDocShell->SetDocumentModified();
- pDocShell->SetInUndo( FALSE );
-}
-
-void ScUndoSetGrammar::Undo()
-{
- DoChange( meOldGrammar );
-}
-
-void ScUndoSetGrammar::Redo()
-{
- DoChange( meNewGrammar );
-}
-
-void ScUndoSetGrammar::Repeat(SfxRepeatTarget& /* rTarget */)
-{
-#if 0
-// erAck: 2006-09-07T23:00+0200 commented out in CWS scr1c1
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
- Execute( FID_TAB_USE_R1C1, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
-#endif
-}
-
-BOOL ScUndoSetGrammar::CanRepeat(SfxRepeatTarget& rTarget) const
-{
- return (rTarget.ISA(ScTabViewTarget));
-}
-
-String ScUndoSetGrammar::GetComment() const
-{
- return ScGlobal::GetRscString( STR_UNDO_TAB_R1C1 );
-}
-
-
-
-
-
+//UNUSED2009-05 ScUndoSetGrammar::ScUndoSetGrammar( ScDocShell* pShell,
+//UNUSED2009-05 formula::FormulaGrammar::Grammar eGrammar ) :
+//UNUSED2009-05 ScSimpleUndo( pShell ),
+//UNUSED2009-05 meNewGrammar( eGrammar )
+//UNUSED2009-05 {
+//UNUSED2009-05 meOldGrammar = pDocShell->GetDocument()->GetGrammar();
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 __EXPORT ScUndoSetGrammar::~ScUndoSetGrammar()
+//UNUSED2009-05 {
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 void ScUndoSetGrammar::DoChange( formula::FormulaGrammar::Grammar eGrammar )
+//UNUSED2009-05 {
+//UNUSED2009-05 pDocShell->SetInUndo( TRUE );
+//UNUSED2009-05 ScDocument* pDoc = pDocShell->GetDocument();
+//UNUSED2009-05 pDoc->SetGrammar( eGrammar );
+//UNUSED2009-05 pDocShell->SetDocumentModified();
+//UNUSED2009-05 pDocShell->SetInUndo( FALSE );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Undo()
+//UNUSED2009-05 {
+//UNUSED2009-05 DoChange( meOldGrammar );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Redo()
+//UNUSED2009-05 {
+//UNUSED2009-05 DoChange( meNewGrammar );
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 void __EXPORT ScUndoSetGrammar::Repeat(SfxRepeatTarget& /* rTarget */)
+//UNUSED2009-05 {
+//UNUSED2009-05 #if 0
+//UNUSED2009-05 // erAck: 2006-09-07T23:00+0200 commented out in CWS scr1c1
+//UNUSED2009-05 if (rTarget.ISA(ScTabViewTarget))
+//UNUSED2009-05 ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+//UNUSED2009-05 Execute( FID_TAB_USE_R1C1, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
+//UNUSED2009-05 #endif
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 BOOL __EXPORT ScUndoSetGrammar::CanRepeat(SfxRepeatTarget& rTarget) const
+//UNUSED2009-05 {
+//UNUSED2009-05 return (rTarget.ISA(ScTabViewTarget));
+//UNUSED2009-05 }
+//UNUSED2009-05
+//UNUSED2009-05 String __EXPORT ScUndoSetGrammar::GetComment() const
+//UNUSED2009-05 {
+//UNUSED2009-05 return ScGlobal::GetRscString( STR_UNDO_TAB_R1C1 );
+//UNUSED2009-05 }
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index cfe51aed6edc..f3418a84e2ef 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1093,7 +1093,7 @@ BOOL lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( rRange, IDF_CONTENTS, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_CONTENTS|IDF_NOCAPTIONS, FALSE, pUndoDoc );
}
pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index ccd1b558342b..07ed8709ab01 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -500,6 +500,10 @@ void Chart2Positioner::glueState()
ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
SCCOLROW n1 = aData.Ref1.nCol;
SCCOLROW n2 = aData.Ref2.nCol;
+ if (n1 > MAXCOL)
+ n1 = MAXCOL;
+ if (n2 > MAXCOL)
+ n2 = MAXCOL;
SCCOLROW nTmp = n2 - n1 + 1;
if (n1 < mnStartCol)
mnStartCol = static_cast<SCCOL>(n1);
@@ -510,14 +514,18 @@ void Chart2Positioner::glueState()
n1 = aData.Ref1.nRow;
n2 = aData.Ref2.nRow;
+ if (n1 > MAXROW)
+ n1 = MAXROW;
+ if (n2 > MAXROW)
+ n2 = MAXROW;
nTmp = n2 - n1 + 1;
if (n1 < mnStartRow)
- mnStartRow = static_cast<SCCOL>(n1);
+ mnStartRow = static_cast<SCROW>(n1);
if (n2 > nEndRow)
- nEndRow = static_cast<SCCOL>(n2);
+ nEndRow = static_cast<SCROW>(n2);
if (nTmp > nMaxRows)
- nMaxRows = static_cast<SCCOL>(nTmp);
+ nMaxRows = static_cast<SCROW>(nTmp);
}
// total column size ?
@@ -534,6 +542,14 @@ void Chart2Positioner::glueState()
meGlue = GLUETYPE_COLS;
return;
}
+ // #i103540# prevent invalid vector size
+ if ((nC <= 0) || (nR <= 0))
+ {
+ invalidateGlue();
+ mnStartCol = 0;
+ mnStartRow = 0;
+ return;
+ }
sal_uInt32 nCR = static_cast<sal_uInt32>(nC*nR);
const sal_uInt8 nHole = 0;
@@ -957,15 +973,6 @@ void lcl_convertTokensToString(OUString& rStr, const vector<ScSharedTokenRef>& r
func.getString(rStr);
}
-void lcl_convertTokenToString(OUString& rStr, const ScSharedTokenRef& rToken, ScDocument* pDoc,
- FormulaGrammar::Grammar eGrammar)
-{
- const sal_Unicode cRangeSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- Tokens2RangeString func(pDoc, eGrammar, cRangeSep);
- func.operator() (rToken);
- func.getString(rStr);
-}
-
} // anonymous namespace
// DataProvider ==============================================================
@@ -995,44 +1002,6 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
}
}
-void lcl_SeperateOneColumnRange(ScRange aR, const ScAddress& rPos, ScRangeListRef& xRanges)
-{
- if (aR.aStart == rPos)
- {
- aR.aStart.SetRow(aR.aStart.Row() + 1);
- xRanges->Join(aR);
- }
- else if (aR.aEnd == rPos)
- {
- aR.aStart.SetRow(aR.aStart.Row() - 1);
- xRanges->Join(aR);
- }
- else
- {
- xRanges->Join(ScRange(aR.aStart, ScAddress(rPos.Col(), rPos.Row() - 1, rPos.Tab())));
- xRanges->Join(ScRange(ScAddress(rPos.Col(), rPos.Row() + 1, rPos.Tab()), aR.aEnd ));
- }
-}
-
-void lcl_SeperateOneRowRange(ScRange aR, const ScAddress& rPos, ScRangeListRef& xRanges)
-{
- if (aR.aStart == rPos)
- {
- aR.aStart.SetCol(aR.aStart.Col() + 1);
- xRanges->Join(aR);
- }
- else if (aR.aEnd == rPos)
- {
- aR.aStart.SetCol(aR.aStart.Col() - 1);
- xRanges->Join(aR);
- }
- else
- {
- xRanges->Join(ScRange(aR.aStart, ScAddress(rPos.Col() - 1, rPos.Row(), rPos.Tab())));
- xRanges->Join(ScRange(ScAddress(rPos.Col() + 1, rPos.Row(), rPos.Tab()), aR.aEnd ));
- }
-}
-
::sal_Bool SAL_CALL ScChart2DataProvider::createDataSourcePossible( const uno::Sequence< beans::PropertyValue >& aArguments )
throw (uno::RuntimeException)
{
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index d1c65e87ad9b..3c584a94a775 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -255,14 +255,19 @@ void SAL_CALL ScChartsObj::addNewByName( const rtl::OUString& aName,
xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
if( xReceiver.is())
{
+ String sRangeStr;
+ xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
+
// connect
- xReceiver->attachDataProvider( xDataProvider );
+ if( sRangeStr.Len() )
+ xReceiver->attachDataProvider( xDataProvider );
+ else
+ sRangeStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "all" ) );
+
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pDocShell->GetModel(), uno::UNO_QUERY );
xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
// set arguments
- String sRangeStr;
- xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
uno::Sequence< beans::PropertyValue > aArgs( 4 );
aArgs[0] = beans::PropertyValue(
::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c924205bdce5..3e2295d73471 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -60,6 +60,9 @@
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/reflection/XIdlClassProvider.hpp>
#include <comphelper/processfactory.hxx>
#include "docuno.hxx"
@@ -218,21 +221,37 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
aPropSet( lcl_GetDocOptPropertyMap() ),
pDocShell( pDocSh ),
pPrintFuncCache( NULL ),
- maChangesListeners( m_aMutex )
+ maChangesListeners( m_aMutex ),
+ mnXlsWriteProtPass( 0 )
{
// pDocShell may be NULL if this is the base of a ScDocOptionsObj
if ( pDocShell )
{
pDocShell->GetDocument()->AddUnoObject(*this); // SfxModel is derived from SfxListener
+ }
+}
+
+ScModelObj::~ScModelObj()
+{
+ if (pDocShell)
+ pDocShell->GetDocument()->RemoveUnoObject(*this);
+
+ if (xNumberAgg.is())
+ xNumberAgg->setDelegator(uno::Reference<uno::XInterface>());
+
+ delete pPrintFuncCache;
+}
+uno::Reference< uno::XAggregation> ScModelObj::GetFormatter()
+{
+ if ( !xNumberAgg.is() )
+ {
// setDelegator veraendert den RefCount, darum eine Referenz selber halten
// (direkt am m_refCount, um sich beim release nicht selbst zu loeschen)
comphelper::increment( m_refCount );
-
// waehrend des queryInterface braucht man ein Ref auf das
// SvNumberFormatsSupplierObj, sonst wird es geloescht.
- uno::Reference<util::XNumberFormatsSupplier> xFormatter(new SvNumberFormatsSupplierObj(
- pDocShell->GetDocument()->GetFormatTable() ));
+ uno::Reference<util::XNumberFormatsSupplier> xFormatter(new SvNumberFormatsSupplierObj(pDocShell->GetDocument()->GetFormatTable() ));
{
xNumberAgg.set(uno::Reference<uno::XAggregation>( xFormatter, uno::UNO_QUERY ));
// extra block to force deletion of the temporary before setDelegator
@@ -243,20 +262,9 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
if (xNumberAgg.is())
xNumberAgg->setDelegator( (cppu::OWeakObject*)this );
-
comphelper::decrement( m_refCount );
- }
-}
-
-ScModelObj::~ScModelObj()
-{
- if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
-
- if (xNumberAgg.is())
- xNumberAgg->setDelegator(uno::Reference<uno::XInterface>());
-
- delete pPrintFuncCache;
+ } // if ( !xNumberAgg.is() )
+ return xNumberAgg;
}
ScDocument* ScModelObj::GetDocument() const
@@ -277,13 +285,6 @@ void ScModelObj::UpdateAllRowHeights(const ScMarkData* pTabMark)
pDocShell->UpdateAllRowHeights(pTabMark);
}
-ScDrawLayer* ScModelObj::MakeDrawLayer()
-{
- if (pDocShell)
- return pDocShell->MakeDrawLayer();
- return NULL;
-}
-
void ScModelObj::BeforeXMLLoading()
{
if (pDocShell)
@@ -296,6 +297,13 @@ void ScModelObj::AfterXMLLoading(sal_Bool bRet)
pDocShell->AfterXMLLoading(bRet);
}
+ScSheetSaveData* ScModelObj::GetSheetSaveData()
+{
+ if (pDocShell)
+ return pDocShell->GetSheetSaveData();
+ return NULL;
+}
+
uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -316,8 +324,19 @@ uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
SC_QUERYINTERFACE( util::XChangesNotifier )
uno::Any aRet(SfxBaseModel::queryInterface( rType ));
- if ( !aRet.hasValue() && xNumberAgg.is() )
- aRet = xNumberAgg->queryAggregation( rType );
+ if ( !aRet.hasValue()
+ && rType != ::getCppuType((uno::Reference< com::sun::star::document::XDocumentEventBroadcaster>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::frame::XController>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::frame::XFrame>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::script::XInvocation>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::reflection::XIdlClassProvider>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::beans::XFastPropertySet>*)0)
+ && rType != ::getCppuType((uno::Reference< com::sun::star::awt::XWindow>*)0))
+ {
+ GetFormatter();
+ if ( xNumberAgg.is() )
+ aRet = xNumberAgg->queryAggregation( rType );
+ }
return aRet;
}
@@ -342,7 +361,7 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes() throw(uno::RuntimeExcep
const uno::Type* pParentPtr = aParentTypes.getConstArray();
uno::Sequence<uno::Type> aAggTypes;
- if ( xNumberAgg.is() )
+ if ( GetFormatter().is() )
{
const uno::Type& rProvType = ::getCppuType((uno::Reference<lang::XTypeProvider>*) 0);
uno::Any aNumProv(xNumberAgg->queryAggregation(rProvType));
@@ -433,7 +452,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// NumberFormatter-Pointer am Uno-Objekt neu setzen
- if (xNumberAgg.is())
+ if (GetFormatter().is())
{
SvNumberFormatsSupplierObj* pNumFmt =
SvNumberFormatsSupplierObj::getImplementation(
@@ -1430,6 +1449,14 @@ void SAL_CALL ScModelObj::setPropertyValue(
if ( aObjName.getLength() )
pDoc->RestoreChartListener( aObjName );
}
+ else if ( aString.EqualsAscii( "WriteProtectionPassword" ) )
+ {
+ /* This is a hack for #160550# to preserve the write-protection
+ password in an XLS roundtrip. This property MUST NOT be used
+ for any other purpose. This property will be deleted when the
+ feature "Write Protection With Password" will be implemented. */
+ aValue >>= mnXlsWriteProtPass;
+ }
if ( aNewOpt != rOldOpt )
{
@@ -1592,6 +1619,14 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
{
ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SFX_CREATE_MODE_INTERNAL) );
}
+ else if ( aString.EqualsAscii( "WriteProtectionPassword" ) )
+ {
+ /* This is a hack for #160550# to preserve the write-protection
+ password in an XLS roundtrip. This property MUST NOT be used
+ for any other purpose. This property will be deleted when the
+ feature "Write Protection With Password" will be implemented. */
+ aRet <<= mnXlsWriteProtPass;
+ }
}
return aRet;
@@ -1760,7 +1795,7 @@ sal_Int64 SAL_CALL ScModelObj::getSomething(
if ( nRet )
return nRet;
- if ( xNumberAgg.is() )
+ if ( GetFormatter().is() )
{
const uno::Type& rTunnelType = ::getCppuType((uno::Reference<lang::XUnoTunnel>*) 0);
uno::Any aNumTunnel(xNumberAgg->queryAggregation(rTunnelType));
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 1d9f3a1d9213..a50b4003b0ac 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -57,6 +57,7 @@
#include "patattr.hxx"
#include "docpool.hxx"
#include "attrib.hxx"
+#include "clipparam.hxx"
using namespace com::sun::star;
@@ -175,9 +176,8 @@ BOOL lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange,
ScMarkData aSourceMark;
aSourceMark.SelectOneTable( nSrcTab ); // for CopyToClip
aSourceMark.SetMarkArea( rSrcRange );
- pSrcDoc->CopyToClip( rSrcRange.aStart.Col(),rSrcRange.aStart.Row(),
- rSrcRange.aEnd.Col(),rSrcRange.aEnd.Row(),
- FALSE, pClipDoc, FALSE, &aSourceMark );
+ ScClipParam aClipParam(rSrcRange, false);
+ pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aSourceMark, false);
if ( pClipDoc->HasAttrib( 0,0,nSrcTab, MAXCOL,MAXROW,nSrcTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 1b17c2e130ac..6ed8181091ac 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -350,7 +350,7 @@ static BOOL lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
// maybe that IsStorage() already created an error!
if ( bIsStorage )
{
- uno::Reference < embed::XStorage > xStorage(aMedium.GetStorage());
+ uno::Reference < embed::XStorage > xStorage(aMedium.GetStorage( sal_False ));
if ( aMedium.GetLastStorageCreationState() != ERRCODE_NONE )
{
// error during storage creation means _here_ that the medium
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index d4ef17e79a8d..47e1be008645 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -121,56 +121,72 @@ public:
};
//------------------------------------------------------------------------
+//
+struct ProvNamesId_Type
+{
+ const char * pName;
+ sal_uInt16 nType;
+};
-static const sal_Char* __FAR_DATA aProvNames[SC_SERVICE_COUNT] =
- {
- "com.sun.star.sheet.Spreadsheet", // SC_SERVICE_SHEET
- "com.sun.star.text.TextField.URL", // SC_SERVICE_URLFIELD
- "com.sun.star.text.TextField.PageNumber", // SC_SERVICE_PAGEFIELD
- "com.sun.star.text.TextField.PageCount", // SC_SERVICE_PAGESFIELD
- "com.sun.star.text.TextField.Date", // SC_SERVICE_DATEFIELD
- "com.sun.star.text.TextField.Time", // SC_SERVICE_TIMEFIELD
- "com.sun.star.text.TextField.DocumentTitle",// SC_SERVICE_TITLEFIELD
- "com.sun.star.text.TextField.FileName", // SC_SERVICE_FILEFIELD
- "com.sun.star.text.TextField.SheetName", // SC_SERVICE_SHEETFIELD
- "com.sun.star.style.CellStyle", // SC_SERVICE_CELLSTYLE
- "com.sun.star.style.PageStyle", // SC_SERVICE_PAGESTYLE
- "com.sun.star.sheet.TableAutoFormat", // SC_SERVICE_AUTOFORMAT
- "com.sun.star.sheet.SheetCellRanges", // SC_SERVICE_CELLRANGES
- "com.sun.star.drawing.GradientTable", // SC_SERVICE_GRADTAB
- "com.sun.star.drawing.HatchTable", // SC_SERVICE_HATCHTAB
- "com.sun.star.drawing.BitmapTable", // SC_SERVICE_BITMAPTAB
- "com.sun.star.drawing.TransparencyGradientTable", // SC_SERVICE_TRGRADTAB
- "com.sun.star.drawing.MarkerTable", // SC_SERVICE_MARKERTAB
- "com.sun.star.drawing.DashTable", // SC_SERVICE_DASHTAB
- "com.sun.star.text.NumberingRules", // SC_SERVICE_NUMRULES
- "com.sun.star.sheet.Defaults", // SC_SERVICE_DOCDEFLTS
- "com.sun.star.drawing.Defaults", // SC_SERVICE_DRAWDEFLTS
- "com.sun.star.comp.SpreadsheetSettings", // SC_SERVICE_DOCSPRSETT
- "com.sun.star.document.Settings", // SC_SERVICE_DOCCONF
- "com.sun.star.image.ImageMapRectangleObject",// SC_SERVICE_IMAP_RECT
- "com.sun.star.image.ImageMapCircleObject", // SC_SERVICE_IMAP_CIRC
- "com.sun.star.image.ImageMapPolygonObject", // SC_SERVICE_IMAP_POLY
+static const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
+{
+ { "com.sun.star.sheet.Spreadsheet", SC_SERVICE_SHEET },
+ { "com.sun.star.text.TextField.URL", SC_SERVICE_URLFIELD },
+ { "com.sun.star.text.TextField.PageNumber", SC_SERVICE_PAGEFIELD },
+ { "com.sun.star.text.TextField.PageCount", SC_SERVICE_PAGESFIELD },
+ { "com.sun.star.text.TextField.Date", SC_SERVICE_DATEFIELD },
+ { "com.sun.star.text.TextField.Time", SC_SERVICE_TIMEFIELD },
+ { "com.sun.star.text.TextField.DocumentTitle", SC_SERVICE_TITLEFIELD },
+ { "com.sun.star.text.TextField.FileName", SC_SERVICE_FILEFIELD },
+ { "com.sun.star.text.TextField.SheetName", SC_SERVICE_SHEETFIELD },
+ { "com.sun.star.style.CellStyle", SC_SERVICE_CELLSTYLE },
+ { "com.sun.star.style.PageStyle", SC_SERVICE_PAGESTYLE },
+ { "com.sun.star.sheet.TableAutoFormat", SC_SERVICE_AUTOFORMAT },
+ { "com.sun.star.sheet.SheetCellRanges", SC_SERVICE_CELLRANGES },
+ { "com.sun.star.drawing.GradientTable", SC_SERVICE_GRADTAB },
+ { "com.sun.star.drawing.HatchTable", SC_SERVICE_HATCHTAB },
+ { "com.sun.star.drawing.BitmapTable", SC_SERVICE_BITMAPTAB },
+ { "com.sun.star.drawing.TransparencyGradientTable", SC_SERVICE_TRGRADTAB },
+ { "com.sun.star.drawing.MarkerTable", SC_SERVICE_MARKERTAB },
+ { "com.sun.star.drawing.DashTable", SC_SERVICE_DASHTAB },
+ { "com.sun.star.text.NumberingRules", SC_SERVICE_NUMRULES },
+ { "com.sun.star.sheet.Defaults", SC_SERVICE_DOCDEFLTS },
+ { "com.sun.star.drawing.Defaults", SC_SERVICE_DRAWDEFLTS },
+ { "com.sun.star.comp.SpreadsheetSettings", SC_SERVICE_DOCSPRSETT },
+ { "com.sun.star.document.Settings", SC_SERVICE_DOCCONF },
+ { "com.sun.star.image.ImageMapRectangleObject", SC_SERVICE_IMAP_RECT },
+ { "com.sun.star.image.ImageMapCircleObject", SC_SERVICE_IMAP_CIRC },
+ { "com.sun.star.image.ImageMapPolygonObject", SC_SERVICE_IMAP_POLY },
// #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver
- "com.sun.star.document.ExportGraphicObjectResolver", // SC_SERVICE_EXPORT_GOR
- "com.sun.star.document.ImportGraphicObjectResolver", // SC_SERVICE_IMPORT_GOR
- "com.sun.star.document.ExportEmbeddedObjectResolver", // SC_SERVICE_EXPORT_EOR
- "com.sun.star.document.ImportEmbeddedObjectResolver", // SC_SERVICE_IMPORT_EOR
-
- SC_SERVICENAME_VALBIND, // SC_SERVICE_VALBIND
- SC_SERVICENAME_LISTCELLBIND, // SC_SERVICE_LISTCELLBIND
- SC_SERVICENAME_LISTSOURCE, // SC_SERVICE_LISTSOURCE
- SC_SERVICENAME_CELLADDRESS, // SC_SERVICE_CELLADDRESS
- SC_SERVICENAME_RANGEADDRESS, // SC_SERVICE_RANGEADDRESS
-
- "com.sun.star.sheet.DocumentSettings", // SC_SERVICE_SHEETDOCSET
-
- SC_SERVICENAME_CHDATAPROV, // SC_SERVICE_CHDATAPROV
- SC_SERVICENAME_FORMULAPARS, // SC_SERVICE_FORMULAPARS
- SC_SERVICENAME_OPCODEMAPPER, // SC_SERVICE_OPCODEMAPPER
- "ooo.vba.VBACodeNameProvider", // SC_SERVICE_OPCODEMAPPER
- };
+ { "com.sun.star.document.ExportGraphicObjectResolver", SC_SERVICE_EXPORT_GOR },
+ { "com.sun.star.document.ImportGraphicObjectResolver", SC_SERVICE_IMPORT_GOR },
+ { "com.sun.star.document.ExportEmbeddedObjectResolver", SC_SERVICE_EXPORT_EOR },
+ { "com.sun.star.document.ImportEmbeddedObjectResolver", SC_SERVICE_IMPORT_EOR },
+
+ { SC_SERVICENAME_VALBIND, SC_SERVICE_VALBIND },
+ { SC_SERVICENAME_LISTCELLBIND, SC_SERVICE_LISTCELLBIND },
+ { SC_SERVICENAME_LISTSOURCE, SC_SERVICE_LISTSOURCE },
+ { SC_SERVICENAME_CELLADDRESS, SC_SERVICE_CELLADDRESS },
+ { SC_SERVICENAME_RANGEADDRESS, SC_SERVICE_RANGEADDRESS },
+
+ { "com.sun.star.sheet.DocumentSettings",SC_SERVICE_SHEETDOCSET },
+
+ { SC_SERVICENAME_CHDATAPROV, SC_SERVICE_CHDATAPROV },
+ { SC_SERVICENAME_FORMULAPARS, SC_SERVICE_FORMULAPARS },
+ { SC_SERVICENAME_OPCODEMAPPER, SC_SERVICE_OPCODEMAPPER },
+ { "ooo.vba.VBACodeNameProvider", SC_SERVICE_VBACODENAMEPROVIDER },
+
+ // case-correct versions of the service names (#i102468#)
+ { "com.sun.star.text.textfield.URL", SC_SERVICE_URLFIELD },
+ { "com.sun.star.text.textfield.PageNumber", SC_SERVICE_PAGEFIELD },
+ { "com.sun.star.text.textfield.PageCount", SC_SERVICE_PAGESFIELD },
+ { "com.sun.star.text.textfield.Date", SC_SERVICE_DATEFIELD },
+ { "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD },
+ { "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD },
+ { "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD },
+ { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD },
+};
//
// old service names that were in 567 still work in createInstance,
@@ -244,11 +260,17 @@ sal_uInt16 ScServiceProvider::GetProviderType(const String& rServiceName)
{
if (rServiceName.Len())
{
- USHORT i;
- for (i=0; i<SC_SERVICE_COUNT; i++)
- if (rServiceName.EqualsAscii( aProvNames[i] ))
- return i;
+ const sal_uInt16 nEntries =
+ sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ for (sal_uInt16 i = 0; i < nEntries; i++)
+ {
+ if (rServiceName.EqualsAscii( aProvNamesId[i].pName ))
+ {
+ return aProvNamesId[i].nType;
+ }
+ }
+ USHORT i;
for (i=0; i<SC_SERVICE_COUNT; i++)
{
DBG_ASSERT( aOldNames[i], "ScServiceProvider::GetProviderType: no oldname => crash");
@@ -441,10 +463,13 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames()
{
- uno::Sequence<rtl::OUString> aRet(SC_SERVICE_COUNT);
+ const sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ uno::Sequence<rtl::OUString> aRet(nEntries);
rtl::OUString* pArray = aRet.getArray();
- for (sal_uInt16 i = 0; i < SC_SERVICE_COUNT; i++)
- pArray[i] = rtl::OUString::createFromAscii( aProvNames[i] );
+ for (sal_uInt16 i = 0; i < nEntries; i++)
+ {
+ pArray[i] = rtl::OUString::createFromAscii( aProvNamesId[i].pName );
+ }
return aRet;
}
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index bd481dfc49f0..a9e6a799e010 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -897,6 +897,47 @@ uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getEnd() throw(uno::
return xRange;
}
+// XUnoTunnel
+
+sal_Int64 SAL_CALL ScDrawTextCursor::getSomething(
+ const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
+{
+ if ( rId.getLength() == 16 &&
+ 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+ rId.getConstArray(), 16 ) )
+ {
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
+ }
+ return SvxUnoTextCursor::getSomething( rId );
+}
+
+// static
+const uno::Sequence<sal_Int8>& ScDrawTextCursor::getUnoTunnelId()
+{
+ static uno::Sequence<sal_Int8> * pSeq = 0;
+ if( !pSeq )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if( !pSeq )
+ {
+ static uno::Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
+ }
+ }
+ return *pSeq;
+}
+
+// static
+ScDrawTextCursor* ScDrawTextCursor::getImplementation( const uno::Reference<uno::XInterface> xObj )
+{
+ ScDrawTextCursor* pRet = NULL;
+ uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
+ if (xUT.is())
+ pRet = reinterpret_cast<ScDrawTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
+ return pRet;
+}
+
//------------------------------------------------------------------------
ScSimpleEditSourceHelper::ScSimpleEditSourceHelper()
diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk
index fb1cc00488b8..71727297d078 100644
--- a/sc/source/ui/vba/makefile.mk
+++ b/sc/source/ui/vba/makefile.mk
@@ -45,7 +45,7 @@ DLLPRE =
dummy:
@echo "not building vba..."
.ENDIF
-
+.IF "$(L10N_framework)"==""
INCPRE=$(INCCOM)$/$(TARGET)
# ------------------------------------------------------------------
@@ -135,11 +135,13 @@ SLOFILES= \
$(SLO)$/vbaspinbutton.obj \
$(SLO)$/vbaimage.obj \
$(SLO)$/service.obj
-
+.ENDIF
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
+
ALLTAR : \
$(MISC)$/$(TARGET).don \
@@ -149,3 +151,4 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
echo $@
+.ENDIF
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 54c8ff12e189..c2d0f68fc6ef 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -206,7 +206,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
break;
case SID_COPY: // Kopieren
- bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED);
// nur wegen Matrix nicht editierbar? Matrix nicht zerreissen
//! schlaegt nicht zu, wenn geschuetzt UND Matrix, aber damit
//! muss man leben.. wird in Copy-Routine abgefangen, sonst
@@ -443,7 +442,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
SfxBindings& rBindings = GetViewData()->GetBindings();
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( FID_PASTE_CONTENTS );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
@@ -453,7 +452,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet )
{
// SID_PASTE
-// FID_PASTE_CONTENTS
+// SID_PASTE_SPECIAL
// SID_CLIPBOARD_FORMAT_ITEMS
if ( !pImpl->m_pClipEvtLstnr )
@@ -490,7 +489,7 @@ void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet )
if (bDisable)
{
rSet.DisableItem( SID_PASTE );
- rSet.DisableItem( FID_PASTE_CONTENTS );
+ rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
}
else if ( rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) != SFX_ITEM_UNKNOWN )
@@ -670,15 +669,9 @@ void ScCellShell::GetState(SfxItemSet &rSet)
nErrCode = pFCell->GetErrCode();
}
- if ( nErrCode > 0 )
- rSet.Put( SfxStringItem( nWhich,
- ScGlobal::GetLongErrorString( nErrCode ) ) );
- else
- {
- String aFuncStr;
- if ( pTabViewShell->GetFunction( aFuncStr ) )
- rSet.Put( SfxStringItem( nWhich, aFuncStr ) );
- }
+ String aFuncStr;
+ if ( pTabViewShell->GetFunction( aFuncStr, nErrCode ) )
+ rSet.Put( SfxStringItem( nWhich, aFuncStr ) );
}
}
break;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index e5bb702402d8..f610e28b3fc5 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -104,6 +104,7 @@
#include "dpgroup.hxx" // for ScDPNumGroupInfo
#include "spellparam.hxx"
#include "postit.hxx"
+#include "clipparam.hxx"
#include "globstr.hrc"
#include "scui_def.hxx" //CHINA001
@@ -1182,41 +1183,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_PASTE:
{
- Window* pWin = GetViewData()->GetActiveWin();
- ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
- ScDocument* pThisDoc = GetViewData()->GetDocument();
- ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
- if ( pOwnClip && pDPObj )
- {
- // paste from Calc into DataPilot table: sort (similar to drag & drop)
-
- ScDocument* pClipDoc = pOwnClip->GetDocument();
- SCTAB nSourceTab = pOwnClip->GetVisibleTab();
-
- SCCOL nClipStartX;
- SCROW nClipStartY;
- SCCOL nClipEndX;
- SCROW nClipEndY;
- pClipDoc->GetClipStart( nClipStartX, nClipStartY );
- pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
- nClipEndX = nClipEndX + nClipStartX;
- nClipEndY = nClipEndY + nClipStartY; // GetClipArea returns the difference
-
- ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
- BOOL bDone = pTabViewShell->DataPilotMove( aSource, GetViewData()->GetCurPos() );
- if ( !bDone )
- pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
- }
- else
- {
- // normal paste
- WaitObject aWait( GetViewData()->GetDialogParent() );
- pTabViewShell->PasteFromSystem();
- }
+ PasteFromClipboard ( GetViewData(), pTabViewShell, true );
rReq.Done();
}
- pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
break;
case SID_CLIPBOARD_FORMAT_ITEMS:
@@ -1418,7 +1387,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pTabViewShell->CellContentChanged(); // => PasteFromXXX ???
break;
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
// Unterscheidung, ob eigene oder fremde Daten,
// dadurch FID_INS_CELL_CONTENTS ueberfluessig
{
@@ -1516,43 +1485,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
break;
-#if 0
- // clipboard slots were used only for old basic:
-
- case SID_GET_CLPBRD_FORMAT_COUNT:
- rReq.SetReturnValue( SfxUInt16Item( nSlot, Clipboard::GetFormatCount() ) );
- break;
-
- case SID_GET_CLPBRD_FORMAT_BY_IDX:
- if (pReqArgs)
- {
- const SfxPoolItem* pItem;
- if ( pReqArgs->GetItemState(nSlot, TRUE, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt16Item) )
- {
- USHORT nCount = Clipboard::GetFormatCount();
- USHORT nPos = ((const SfxUInt16Item*)pItem)->GetValue(); // 1-based
- if ( nPos && nPos <= nCount )
- rReq.SetReturnValue( SfxUInt32Item( nSlot, Clipboard::GetFormat(--nPos) ) );
- }
- }
- break;
-
- case SID_GET_CLPBRD_FORMAT_NAME:
- if (pReqArgs)
- {
- const SfxPoolItem* pItem;
- if ( pReqArgs->GetItemState(nSlot, TRUE, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
- {
- String aName = Exchange::GetFormatName(
- ((const SfxUInt32Item*)pItem)->GetValue() );
- rReq.SetReturnValue( SfxStringItem( nSlot, aName ) );
- }
- }
- break;
-#endif
-
//
// sonstiges
//
@@ -2226,3 +2158,52 @@ IMPL_LINK( ScCellShell, DialogClosed, AbstractScLinkedAreaDlg*, EMPTYARG )
return 0;
}
+void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, bool bShowDialog )
+{
+ Window* pWin = pViewData->GetActiveWin();
+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
+ ScDocument* pThisDoc = pViewData->GetDocument();
+ ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( pViewData->GetCurX(),
+ pViewData->GetCurY(), pViewData->GetTabNo() );
+ if ( pOwnClip && pDPObj )
+ {
+ // paste from Calc into DataPilot table: sort (similar to drag & drop)
+
+ ScDocument* pClipDoc = pOwnClip->GetDocument();
+ SCTAB nSourceTab = pOwnClip->GetVisibleTab();
+
+ SCCOL nClipStartX;
+ SCROW nClipStartY;
+ SCCOL nClipEndX;
+ SCROW nClipEndY;
+ pClipDoc->GetClipStart( nClipStartX, nClipStartY );
+ pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
+ nClipEndX = nClipEndX + nClipStartX;
+ nClipEndY = nClipEndY + nClipStartY; // GetClipArea returns the difference
+
+ ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
+ BOOL bDone = pTabViewShell->DataPilotMove( aSource, pViewData->GetCurPos() );
+ if ( !bDone )
+ pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
+ }
+ else
+ {
+ // normal paste
+ WaitObject aWait( pViewData->GetDialogParent() );
+ if (!pOwnClip)
+ pTabViewShell->PasteFromSystem();
+ else
+ {
+ ScDocument* pClipDoc = pOwnClip->GetDocument();
+ sal_uInt16 nFlags = IDF_ALL;
+ if (pClipDoc->GetClipParam().isMultiRange())
+ // For multi-range paste, we paste values by default.
+ nFlags &= ~IDF_FORMULA;
+
+ pTabViewShell->PasteFromClip( nFlags, pClipDoc,
+ PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE,
+ bShowDialog ); // allow warning dialog
+ }
+ }
+ pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
+}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index eabf33f3defc..039e4dc256ba 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1235,22 +1235,6 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet )
bOk = pDBData->HasQueryParam() ||
pDBData->HasSortParam() ||
pDBData->HasSubTotalParam();
-#if OLD_PIVOT_IMPLEMENTATION
- if (!bOk)
- {
- // Pivottabelle mit den Daten als Quellbereich ?
- ScRange aDataRange;
- pDBData->GetArea(aDataRange);
- ScPivotCollection* pPivotCollection = pDoc->GetPivotCollection();
- USHORT nCount = pPivotCollection ? pPivotCollection->GetCount() : 0;
- for (USHORT i=0; i<nCount; i++)
- {
- ScPivot* pTemp = (*pPivotCollection)[i];
- if ( pTemp && pTemp->GetSrcArea().Intersects( aDataRange ) )
- bOk = TRUE;
- }
- }
-#endif
}
}
if (!bOk)
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 0c59e083f0fe..ef68bbc9bd0c 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -828,28 +828,28 @@ void ScDrawView::MarkDropObj( SdrObject* pObj )
}
}
-void ScDrawView::CaptionTextDirection( USHORT nSlot )
-{
- if(nSlot != SID_TEXTDIRECTION_LEFT_TO_RIGHT && nSlot != SID_TEXTDIRECTION_TOP_TO_BOTTOM)
- return;
-
- SdrObject* pObject = GetTextEditObject();
- if ( ScDrawLayer::IsNoteCaption( pObject ) )
- {
- if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
- {
- SfxItemSet aAttr(pCaption->GetMergedItemSet());
- aAttr.Put( SvxWritingModeItem(
- nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
- com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
- SDRATTR_TEXTDIRECTION ) );
- pCaption->SetMergedItemSet(aAttr);
- FuPoor* pPoor = pViewData->GetView()->GetDrawFuncPtr();
- if ( pPoor )
- {
- FuText* pText = static_cast<FuText*>(pPoor);
- pText->StopEditMode(TRUE);
- }
- }
- }
-}
+//UNUSED2009-05 void ScDrawView::CaptionTextDirection( USHORT nSlot )
+//UNUSED2009-05 {
+//UNUSED2009-05 if(nSlot != SID_TEXTDIRECTION_LEFT_TO_RIGHT && nSlot != SID_TEXTDIRECTION_TOP_TO_BOTTOM)
+//UNUSED2009-05 return;
+//UNUSED2009-05
+//UNUSED2009-05 SdrObject* pObject = GetTextEditObject();
+//UNUSED2009-05 if ( ScDrawLayer::IsNoteCaption( pObject ) )
+//UNUSED2009-05 {
+//UNUSED2009-05 if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
+//UNUSED2009-05 {
+//UNUSED2009-05 SfxItemSet aAttr(pCaption->GetMergedItemSet());
+//UNUSED2009-05 aAttr.Put( SvxWritingModeItem(
+//UNUSED2009-05 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
+//UNUSED2009-05 com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
+//UNUSED2009-05 SDRATTR_TEXTDIRECTION ) );
+//UNUSED2009-05 pCaption->SetMergedItemSet(aAttr);
+//UNUSED2009-05 FuPoor* pPoor = pViewData->GetView()->GetDrawFuncPtr();
+//UNUSED2009-05 if ( pPoor )
+//UNUSED2009-05 {
+//UNUSED2009-05 FuText* pText = static_cast<FuText*>(pPoor);
+//UNUSED2009-05 pText->StopEditMode(TRUE);
+//UNUSED2009-05 }
+//UNUSED2009-05 }
+//UNUSED2009-05 }
+//UNUSED2009-05 }
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index d9c19f02058a..022eabdc11cf 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -268,7 +268,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
break;
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractPasteDialog* pDlg = pFact->CreatePasteDialog( pViewData->GetDialogParent() );
@@ -714,7 +714,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( FID_PASTE_CONTENTS );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
@@ -742,7 +742,7 @@ void __EXPORT ScEditShell::GetClipState( SfxItemSet& rSet )
switch (nWhich)
{
case SID_PASTE:
- case FID_PASTE_CONTENTS:
+ case SID_PASTE_SPECIAL:
if( !bPastePossible )
rSet.DisableItem( nWhich );
break;
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index b2f3e12d1ee6..36f6c682832f 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -824,6 +824,11 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
bNumFormatChanged, aOldSet, rNewSet ) )
pDoc->InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
+ SCTAB nTabCount = pDoc->GetTableCount();
+ for (SCTAB nTab=0; nTab<nTabCount; nTab++)
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
ULONG nOldFormat = ((const SfxUInt32Item&)aOldSet.
Get( ATTR_VALUE_FORMAT )).GetValue();
ULONG nNewFormat = ((const SfxUInt32Item&)rNewSet.
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5397377b69cc..de2b962f3272 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -122,18 +122,11 @@
#include "tabprotection.hxx"
#include "postit.hxx"
-// #114409#
-#include <vcl/salbtype.hxx> // FRound
#include "drawview.hxx"
#include <svx/sdrpagewindow.hxx>
-#include <svx/sdrpaintwindow.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <vcl/svapp.hxx>
-
-#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
-#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/sdr/overlay/overlayselection.hxx>
using namespace com::sun::star;
using ::com::sun::star::uno::Sequence;
@@ -359,8 +352,7 @@ void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, c
}
}
-//==================================================================
-
+// ---------------------------------------------------------------------------
// WB_DIALOGCONTROL noetig fuer UNO-Controls
ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhichPos )
: Window( pParent, WB_CLIPCHILDREN | WB_DIALOGCONTROL ),
@@ -383,9 +375,6 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
bEEMouse( FALSE ),
nMouseStatus( SC_GM_NONE ),
nNestedButtonState( SC_NESTEDBUTTON_NONE ),
-#if OLD_PIVOT_IMPLEMENTATION
- bPivotMouse( FALSE ),
-#endif
bDPMouse( FALSE ),
bRFMouse( FALSE ),
nPagebreakMouse( SC_PD_NONE ),
@@ -1844,15 +1833,6 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
return;
}
-#if OLD_PIVOT_IMPLEMENTATION
- if (bPivotMouse)
- {
- PivotMouseButtonUp( rMEvt );
- bPivotMouse = FALSE;
- return;
- }
-#endif
-
if (bDPMouse)
{
DPMouseButtonUp( rMEvt ); // resets bDPMouse
@@ -2260,14 +2240,6 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt )
return;
}
-#if OLD_PIVOT_IMPLEMENTATION
- if (bPivotMouse)
- {
- PivotMouseMove( rMEvt );
- return;
- }
-#endif
-
if (bDPMouse)
{
DPMouseMove( rMEvt );
@@ -2478,10 +2450,6 @@ void ScGridWindow::Tracking( const TrackingEvent& rTEvt )
{
if (!pViewData->GetView()->IsInActivatePart())
{
-#if OLD_PIVOT_IMPLEMENTATION
- if (bPivotMouse)
- bPivotMouse = FALSE; // gezeichnet wird per bDragRect
-#endif
if (bDPMouse)
bDPMouse = FALSE; // gezeichnet wird per bDragRect
if (bDragRect)
@@ -4890,7 +4858,6 @@ BOOL ScGridWindow::GetEditUrlOrError( BOOL bSpellErr, const Point& rPos,
MapMode aEditMode = pViewData->GetLogicMode(eWhich); // ohne Drawing-Skalierung
Rectangle aLogicEdit = PixelToLogic( aEditRect, aEditMode );
long nThisColLogic = aLogicEdit.Right() - aLogicEdit.Left() + 1;
-
Size aPaperSize = Size( 1000000, 1000000 );
if(pCell->GetCellType() == CELLTYPE_FORMULA)
{
@@ -5205,37 +5172,30 @@ void ScGridWindow::UpdateCursorOverlay()
}
}
- //
- // convert into logic units and create overlay object
- //
-
if ( aPixelRects.size() )
{
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
-
- std::vector<Rectangle>::const_iterator aPixelEnd( aPixelRects.end() );
- for ( std::vector<Rectangle>::const_iterator aPixelIter( aPixelRects.begin() );
- aPixelIter != aPixelEnd; ++aPixelIter )
- {
- Rectangle aLogic( PixelToLogic( *aPixelIter, aDrawMode ) );
-
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
-
- aRanges.push_back( a2DRange );
- }
-
// #i70788# get the OverlayManager safely
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
if(pOverlayManager)
{
- BOOL bOld = pViewData->GetView()->IsOldSelection();
+ const Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
- ScOverlayType eType = bOld ? SC_OVERLAY_INVERT : SC_OVERLAY_SOLID;
- Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
- sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aCursorColor, aRanges );
+ for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
+ {
+ const Rectangle aRA(aPixelRects[a]);
+ basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
+ }
+
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_SOLID,
+ aCursorColor,
+ aRanges,
+ false);
pOverlayManager->add(*pOverlay);
mpOOCursors = new ::sdr::overlay::OverlayObjectList;
@@ -5260,50 +5220,52 @@ void ScGridWindow::UpdateSelectionOverlay()
SetMapMode( aDrawMode );
DeleteSelectionOverlay();
-
std::vector<Rectangle> aPixelRects;
GetSelectionRects( aPixelRects );
if ( aPixelRects.size() && pViewData->IsActive() )
{
- SCTAB nTab = pViewData->GetTabNo();
- BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( nTab );
- BOOL bOld = pViewData->GetView()->IsOldSelection();
-
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
+ // #i70788# get the OverlayManager safely
+ ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
- std::vector<Rectangle>::const_iterator aPixelEnd( aPixelRects.end() );
- for ( std::vector<Rectangle>::const_iterator aPixelIter( aPixelRects.begin() );
- aPixelIter != aPixelEnd; ++aPixelIter )
+ if(pOverlayManager)
{
- Rectangle aPixel( *aPixelIter );
- if ( !bOld )
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
+
+ for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
{
- // for transparent selection, add a pixel so the border is on the grid on all edges
- if ( bLayoutRTL )
- aPixel.Right() += 1;
- else
- aPixel.Left() -= 1;
- aPixel.Top() -= 1;
+ const Rectangle aRA(aPixelRects[a]);
+ basegfx::B2DRange aRB(aRA.Left() - 1, aRA.Top() - 1, aRA.Right(), aRA.Bottom());
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
}
- Rectangle aLogic( PixelToLogic( aPixel, aDrawMode ) );
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
+ // #i97672# get the system's hilight color and limit it to the maximum
+ // allowed luminance. This is needed to react on too bright hilight colors
+ // which would otherwise vive a bad visualisation
+ Color aHighlight(GetSettings().GetStyleSettings().GetHighlightColor());
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const basegfx::BColor aSelection(aHighlight.getBColor());
+ const double fLuminance(aSelection.luminance());
+ const double fMaxLum(aSvtOptionsDrawinglayer.GetSelectionMaximumLuminancePercent() / 100.0);
- aRanges.push_back( a2DRange );
- }
+ if(fLuminance > fMaxLum)
+ {
+ const double fFactor(fMaxLum / fLuminance);
+ const basegfx::BColor aNewSelection(
+ aSelection.getRed() * fFactor,
+ aSelection.getGreen() * fFactor,
+ aSelection.getBlue() * fFactor);
- // #i70788# get the OverlayManager safely
- ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
+ aHighlight = Color(aNewSelection);
+ }
- if(pOverlayManager)
- {
- ScOverlayType eType = bOld ? SC_OVERLAY_INVERT : SC_OVERLAY_BORDER_TRANSPARENT;
- Color aHighlight( GetSettings().GetStyleSettings().GetHighlightColor() );
- sdr::overlay::OverlayObjectCell* pOverlay =
- new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_TRANSPARENT,
+ aHighlight,
+ aRanges,
+ true);
pOverlayManager->add(*pOverlay);
mpOOSelection = new ::sdr::overlay::OverlayObjectList;
@@ -5355,31 +5317,24 @@ void ScGridWindow::UpdateAutoFillOverlay()
aFillPos.Y() -= 2;
Rectangle aFillRect( aFillPos, Size(6,6) );
- //
- // convert into logic units
- //
-
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
-
- Rectangle aLogic( PixelToLogic( aFillRect, aDrawMode ) );
-
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
-
- aRanges.push_back( a2DRange );
-
// #i70788# get the OverlayManager safely
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
if(pOverlayManager)
{
- BOOL bOld = pViewData->GetView()->IsOldSelection();
+ const Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
+ basegfx::B2DRange aRB(aFillRect.Left(), aFillRect.Top(), aFillRect.Right() + 1, aFillRect.Bottom() + 1);
- ScOverlayType eType = bOld ? SC_OVERLAY_INVERT : SC_OVERLAY_SOLID;
- Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
- sdr::overlay::OverlayObjectCell* pOverlay =
- new sdr::overlay::OverlayObjectCell( eType, aHandleColor, aRanges );
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
+
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_SOLID,
+ aHandleColor,
+ aRanges,
+ false);
pOverlayManager->add(*pOverlay);
mpOOAutoFill = new ::sdr::overlay::OverlayObjectList;
@@ -5490,34 +5445,28 @@ void ScGridWindow::UpdateDragRectOverlay()
aPixelRects.push_back( Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ) );
}
- //
- // convert into logic units and create overlay object
- //
-
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
-
- std::vector<Rectangle>::const_iterator aPixelEnd( aPixelRects.end() );
- for ( std::vector<Rectangle>::const_iterator aPixelIter( aPixelRects.begin() );
- aPixelIter != aPixelEnd; ++aPixelIter )
- {
- Rectangle aLogic( PixelToLogic( *aPixelIter, aDrawMode ) );
-
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
-
- aRanges.push_back( a2DRange );
- }
-
// #i70788# get the OverlayManager safely
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
if(pOverlayManager)
{
- ScOverlayType eType = SC_OVERLAY_INVERT;
- Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
- sdr::overlay::OverlayObjectCell* pOverlay =
- new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
+ // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
+
+ for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
+ {
+ const Rectangle aRA(aPixelRects[a]);
+ basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
+ }
+
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_INVERT,
+ Color(COL_BLACK),
+ aRanges,
+ false);
pOverlayManager->add(*pOverlay);
mpOODragRect = new ::sdr::overlay::OverlayObjectList;
@@ -5544,31 +5493,26 @@ void ScGridWindow::UpdateHeaderOverlay()
DeleteHeaderOverlay();
// Pixel rectangle is in aInvertRect
-
- //
- // convert into logic units and create overlay object
- //
-
if ( !aInvertRect.IsEmpty() )
{
- Rectangle aLogic( PixelToLogic( aInvertRect, aDrawMode ) );
-
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
-
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
- aRanges.push_back( a2DRange );
-
// #i70788# get the OverlayManager safely
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
if(pOverlayManager)
{
- ScOverlayType eType = SC_OVERLAY_INVERT;
- Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
- sdr::overlay::OverlayObjectCell* pOverlay =
- new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
+ // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
+ basegfx::B2DRange aRB(aInvertRect.Left(), aInvertRect.Top(), aInvertRect.Right() + 1, aInvertRect.Bottom() + 1);
+
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
+
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_INVERT,
+ Color(COL_BLACK),
+ aRanges,
+ false);
pOverlayManager->add(*pOverlay);
mpOOHeader = new ::sdr::overlay::OverlayObjectList;
@@ -5619,30 +5563,26 @@ void ScGridWindow::UpdateShrinkOverlay()
}
}
- //
- // convert into logic units and create overlay object
- //
-
if ( !aPixRect.IsEmpty() )
{
- Rectangle aLogic( PixelToLogic( aPixRect, aDrawMode ) );
-
- const basegfx::B2DPoint aTopLeft(aLogic.Left(), aLogic.Top());
- const basegfx::B2DPoint aBottomRight(aLogic.Right(), aLogic.Bottom());
- const basegfx::B2DRange a2DRange(aTopLeft, aBottomRight);
-
- sdr::overlay::OverlayObjectCell::RangeVector aRanges;
- aRanges.push_back( a2DRange );
-
// #i70788# get the OverlayManager safely
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
if(pOverlayManager)
{
- ScOverlayType eType = SC_OVERLAY_INVERT;
- Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
- sdr::overlay::OverlayObjectCell* pOverlay =
- new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges );
+ // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
+ std::vector< basegfx::B2DRange > aRanges;
+ const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
+ basegfx::B2DRange aRB(aPixRect.Left(), aPixRect.Top(), aPixRect.Right() + 1, aPixRect.Bottom() + 1);
+
+ aRB.transform(aTransform);
+ aRanges.push_back(aRB);
+
+ sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
+ sdr::overlay::OVERLAY_INVERT,
+ Color(COL_BLACK),
+ aRanges,
+ false);
pOverlayManager->add(*pOverlay);
mpOOShrink = new ::sdr::overlay::OverlayObjectList;
@@ -5684,121 +5624,4 @@ void ScGridWindow::flushOverlayManager()
}
// ---------------------------------------------------------------------------
-
-// #114409#
-namespace sdr
-{
- namespace overlay
- {
- OverlayObjectCell::OverlayObjectCell( ScOverlayType eType, const Color& rColor, const RangeVector& rRects )
- : OverlayObject( rColor ),
- mePaintType( eType ),
- maRectangles( rRects )
- {
- // no AA for selection overlays
- allowAntiAliase(false);
- }
-
- OverlayObjectCell::~OverlayObjectCell()
- {
- }
-
- drawinglayer::primitive2d::Primitive2DSequence OverlayObjectCell::createOverlayObjectPrimitive2DSequence()
- {
- drawinglayer::primitive2d::Primitive2DSequence aRetval;
- const basegfx::BColor aRGBColor(getBaseColor().getBColor());
- const sal_uInt32 nCount(maRectangles.size());
-
- if(nCount)
- {
- // create fill primities for all rectangles
- // These ranges are meant as rectangles, so it is not sufficient to replace them
- // using the derived polygon. That would leave out the bottom and right lines
- // in a discrete width/height due to polygon painting conventions of leaving off those.
- // To solve, it is either possible to create a view-dependent rectangle primitive
- // handling this internally or to additionally create a hairline primitive to
- // cover these areas (which i will do here)
- const bool bIsTransparent(SC_OVERLAY_BORDER_TRANSPARENT == mePaintType);
- aRetval.realloc(nCount * 2);
-
- for(sal_uInt32 a(0);a < nCount; a++)
- {
- const basegfx::B2DRange& rRange(maRectangles[a]);
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange));
-
- aRetval[a * 2] = drawinglayer::primitive2d::Primitive2DReference(
- new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(aPolygon),
- aRGBColor));
- aRetval[(a * 2) + 1] = drawinglayer::primitive2d::Primitive2DReference(
- new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
- basegfx::B2DPolyPolygon(aPolygon),
- aRGBColor));
- }
-
- if(SC_OVERLAY_INVERT == mePaintType)
- {
- // embed all in invert primitive
- const drawinglayer::primitive2d::Primitive2DReference aInvert(
- new drawinglayer::primitive2d::InvertPrimitive2D(
- aRetval));
-
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1);
- }
- else if(bIsTransparent)
- {
- // embed all rectangles in 75% transparent paint
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
- aRetval,
- 0.75));
-
- // prepare merged PolyPoygon selection outline
- const basegfx::B2DPolyPolygon aPolyPolygon(impGetOverlayPolyPolygon());
- const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline(
- new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
- aPolyPolygon,
- aRGBColor));
-
- // add both to result
- aRetval.realloc(2);
- aRetval[0] = aUnifiedAlpha;
- aRetval[1] = aSelectionOutline;
- }
- }
-
- return aRetval;
- }
-
- basegfx::B2DPolyPolygon OverlayObjectCell::impGetOverlayPolyPolygon() const
- {
- PolyPolygon aPolyPoly;
- const sal_uInt32 nRectCount(maRectangles.size());
-
- for(sal_uInt32 nRect(0); nRect < nRectCount; ++nRect)
- {
- const basegfx::B2DRange& rRange(maRectangles[nRect]);
- const Rectangle aRectangle(
- FRound(rRange.getMinX()), FRound(rRange.getMinY()),
- FRound(rRange.getMaxX()), FRound(rRange.getMaxY()));
-
- if ( nRectCount == 1 || nRect+1 < nRectCount )
- {
- // simply add for all except the last rect
- aPolyPoly.Insert( Polygon( aRectangle ) );
- }
- else
- {
- PolyPolygon aTemp( aPolyPoly );
- aTemp.GetUnion( PolyPolygon( Polygon( aRectangle ) ), aPolyPoly );
- }
- }
-
- return aPolyPoly.getB2DPolyPolygon();
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-// ---------------------------------------------------------------------------
-
// eof
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 92743ef65524..643928a7c8aa 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -104,91 +104,6 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt
ScDPObject* pDPObj = pDoc->GetDPAtCursor(nCol, nRow, nTab);
-#if OLD_PIVOT_IMPLEMENTATION
- ScPivotCollection* pPivotCollection = pDoc->GetPivotCollection();
- ScPivot* pPivot = pPivotCollection->GetPivotAtCursor(nCol, nRow, nTab);
-
- if (pPivot) // alte Pivottabellen
- {
- if (pPivot->IsFilterAtCursor(nCol, nRow, nTab))
- {
- ReleaseMouse(); // falls schon beim ButtonDown gecaptured, #44018#
-
- ScQueryParam aQueryParam;
- pPivot->GetQuery(aQueryParam);
- SCTAB nSrcTab = pPivot->GetSrcArea().aStart.Tab();
-
- SfxItemSet aArgSet( pViewData->GetViewShell()->GetPool(),
- SCITEM_QUERYDATA, SCITEM_QUERYDATA );
- aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
-
- //CHINA001 ScPivotFilterDlg* pDlg = new ScPivotFilterDlg(
- //CHINA001 pViewData->GetViewShell()->GetDialogParent(),
- //CHINA001 aArgSet, nSrcTab );
- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-
- AbstractScPivotFilterDlg* pDlg = pFact->CreateScPivotFilterDlg( pViewData->GetViewShell()->GetDialogParent(),
- aArgSet, nSrcTab,
- RID_SCDLG_PIVOTFILTER);
- DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
- if ( pDlg->Execute() == RET_OK )
- {
- ScPivot* pNewPivot = pPivot->CreateNew();
-
- const ScQueryItem& rQueryItem = pDlg->GetOutputItem();
- pNewPivot->SetQuery(rQueryItem.GetQueryData());
-
- PivotField* pColArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nColCount;
- pPivot->GetColFields( pColArr, nColCount );
- PivotField* pRowArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nRowCount;
- pPivot->GetRowFields( pRowArr, nRowCount );
- PivotField* pDataArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nDataCount;
- pPivot->GetDataFields( pDataArr, nDataCount );
-
- pNewPivot->SetColFields( pColArr, nColCount );
- pNewPivot->SetRowFields( pRowArr, nRowCount );
- pNewPivot->SetDataFields( pDataArr, nDataCount );
-
- pNewPivot->SetName( pPivot->GetName() );
- pNewPivot->SetTag( pPivot->GetTag() );
-
- pViewData->GetDocShell()->PivotUpdate( pPivot, pNewPivot );
- }
- delete pDlg;
- }
- else
- {
- SCCOL nField;
- if (pPivot->GetColFieldAtCursor(nCol, nRow, nTab, nField))
- {
- bPivotMouse = TRUE;
- nPivotField = nField;
- bPivotColField = TRUE;
- nPivotCol = nCol;
- pDragPivot = pPivot;
- PivotTestMouse( rMEvt, TRUE );
- // CaptureMouse();
- StartTracking();
- }
- else if (pPivot->GetRowFieldAtCursor(nCol, nRow, nTab, nField))
- {
- bPivotMouse = TRUE;
- nPivotField = nField;
- bPivotColField = FALSE;
- nPivotCol = nCol;
- pDragPivot = pPivot;
- PivotTestMouse( rMEvt, TRUE );
- // CaptureMouse();
- StartTracking();
- }
- }
- }
-#endif
-
if (pDPObj)
{
USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN;
@@ -256,365 +171,6 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt
}
}
-#if OLD_PIVOT_IMPLEMENTATION
-void ScGridWindow::DoPivotDrop( BOOL bDelete, BOOL bToCols, SCSIZE nDestPos )
-{
- if ( nPivotField == PIVOT_DATA_FIELD && bDelete )
- {
- pViewData->GetView()->ErrorMessage(STR_PIVOT_MOVENOTALLOWED);
- return;
- }
-
- if ( bPivotColField != bToCols && !bDelete )
- {
- SCSIZE nDestCount = bToCols ? pDragPivot->GetColFieldCount()
- : pDragPivot->GetRowFieldCount();
- if ( nDestCount >= PIVOT_MAXFIELD ) // schon voll?
- {
- // Versuch, mehr als PIVOT_MAXFIELD Eintraege zu erzeugen
- pViewData->GetView()->ErrorMessage(STR_PIVOT_ERROR);
- return;
- }
- }
-
- PivotField* pColArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nColCount;
- pDragPivot->GetColFields( pColArr, nColCount );
-
- PivotField* pRowArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nRowCount;
- pDragPivot->GetRowFields( pRowArr, nRowCount );
-
- PivotField* pDataArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nDataCount;
- pDragPivot->GetDataFields( pDataArr, nDataCount );
-
- SCSIZE nOldPos = 0;
- PivotField aMoveField;
-
- PivotField* pSource = bPivotColField ? pColArr : pRowArr;
- SCSIZE& rCount = bPivotColField ? nColCount : nRowCount;
-
- BOOL bFound = FALSE;
- for (SCSIZE i=0; i<rCount && !bFound; i++)
- if (pSource[i].nCol == nPivotField)
- {
- nOldPos = i;
- aMoveField = pSource[i];
- --rCount;
- if (i<rCount)
- memmove( &pSource[i], &pSource[i+1], (rCount-i)*sizeof(PivotField) );
- if ( bPivotColField == bToCols )
- if (nDestPos > i)
- --nDestPos;
- bFound = TRUE;
- }
-
- if (bFound)
- {
- if (!bDelete)
- {
- PivotField* pDest = bToCols ? pColArr : pRowArr;
- SCSIZE& rDestCount = bToCols ? nColCount : nRowCount;
-
- if (nDestPos < rDestCount)
- memmove( &pDest[nDestPos+1], &pDest[nDestPos],
- (rDestCount-nDestPos)*sizeof(PivotField) );
- pDest[nDestPos] = aMoveField;
- ++rDestCount;
- }
-
- BOOL bEmpty = ( nColCount + nRowCount == 0 ||
- ( nColCount + nRowCount == 1 && nDataCount <= 1 ) );
-
- if ( bEmpty ) // Pivottabelle loeschen
- {
- pViewData->GetDocShell()->PivotUpdate( pDragPivot, NULL );
- }
- else
- {
- ScPivot* pNewPivot = pDragPivot->CreateNew();
- pNewPivot->SetColFields( pColArr, nColCount );
- pNewPivot->SetRowFields( pRowArr, nRowCount );
- pNewPivot->SetDataFields( pDataArr, nDataCount );
-
- pNewPivot->SetName( pDragPivot->GetName() );
- pNewPivot->SetTag( pDragPivot->GetTag() );
-
- pViewData->GetDocShell()->PivotUpdate( pDragPivot, pNewPivot );
- }
- pDragPivot = NULL;
- }
- else
- {
- DBG_ASSERT(0,"Pivot-Eintrag nicht gefunden");
- }
-
- delete[] pColArr;
- delete[] pRowArr;
- delete[] pDataArr;
-}
-
-BOOL ScGridWindow::PivotTestMouse( const MouseEvent& rMEvt, BOOL bMove )
-{
- BOOL bRet = FALSE;
- BOOL bTimer = FALSE;
- Point aPos = rMEvt.GetPosPixel();
-
- SCsCOL nDx = 0;
- SCsROW nDy = 0;
- if ( aPos.X() < 0 )
- nDx = -1;
- if ( aPos.Y() < 0 )
- nDy = -1;
- Size aSize = GetOutputSizePixel();
- if ( aPos.X() >= aSize.Width() )
- nDx = 1;
- if ( aPos.Y() >= aSize.Height() )
- nDy = 1;
- if ( nDx != 0 || nDy != 0 )
- {
- if (bDragRect)
- {
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, FALSE );
- bDragRect = FALSE;
- UpdateDragRectOverlay();
- }
-
- if ( nDx != 0 )
- pViewData->GetView()->ScrollX( nDx, WhichH(eWhich) );
- if ( nDy != 0 )
- pViewData->GetView()->ScrollY( nDy, WhichV(eWhich) );
-
- bTimer = TRUE;
- }
-
- SCsCOL nPosX;
- SCsROW nPosY;
- pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
- BOOL bMouseLeft;
- BOOL bMouseTop;
- pViewData->GetMouseQuadrant( aPos, eWhich, nPosX, nPosY, bMouseLeft, bMouseTop );
-
- SCCOL nPiCol1;
- SCROW nPiRow1;
- SCCOL nPiCol2;
- SCROW nPiRow2;
- SCTAB nTab;
- pDragPivot->GetDestArea( nPiCol1, nPiRow1, nPiCol2, nPiRow2, nTab );
-
- if ( nPosX >= (SCsCOL) nPiCol1 && nPosX <= (SCsCOL) nPiCol2 &&
- nPosY >= (SCsROW) nPiRow1 && nPosY <= (SCsROW) nPiRow2 )
- {
- SCsROW nFilterAdd = 2; // Platz fuer Filter-Button
- SCsROW nColRows = 1; //! Ueberschrift: 0, wenn keine Zeilen, aber mehrere Datenfelder
- SCCOL nNewStartX;
- SCROW nNewStartY;
- SCCOL nNewEndX;
- SCROW nNewEndY;
-
- SCsCOL nRelX = nPosX - (SCsCOL) nPiCol1;
- SCsROW nRelY = nPosY - (SCsROW) nPiRow1 - nFilterAdd;
-
- PivotField* pFieldArr = new PivotField[PIVOT_MAXFIELD];
- SCSIZE nColCount;
- pDragPivot->GetColFields( pFieldArr, nColCount );
- SCSIZE nRowCount;
- pDragPivot->GetRowFields( pFieldArr, nRowCount );
- delete[] pFieldArr;
-
- BOOL bBefore;
- SCsCOL nColSize = static_cast<SCsCOL>(Max( nColCount, (SCSIZE) 1 ));
- SCsROW nRowSize = static_cast<SCsROW>(Max( nRowCount, (SCSIZE) 1 ));
-
- BOOL bToCols;
- if (nRelX < nColSize && nRelY >= nRowSize)
- bToCols = TRUE; // links
- else if (nRelY < nRowSize && nRelX >= nColSize)
- bToCols = FALSE; // oben
- else
- bToCols = ( nRelY-nRowSize > static_cast<SCsCOLROW>(nRelX-nColSize) );
-
- SCsCOL nDestCol = 0;
- SCsROW nDestRow = 0;
- BOOL bNothing = FALSE;
-
- if ( bToCols )
- {
- bBefore = bMouseLeft;
- nDestCol = nRelX;
- if (nDestCol < 0)
- {
- nDestCol = 0;
- bBefore = TRUE;
- }
- if (nDestCol >= static_cast<SCsCOL>(nColCount))
- {
- nDestCol = static_cast<SCsCOL>(nColCount)-1;
- bBefore = FALSE;
- }
-
- nNewStartY = nPiRow1 + nFilterAdd + static_cast<SCROW>(nRowCount) + nColRows;
- nNewEndY = nPiRow2 - 1;
- nNewStartX = nPiCol1 + (SCCOL) nDestCol;
- nNewEndX = nNewStartX;
-
- if ( !bPivotColField ) // von der anderen Seite
- {
- if (bBefore)
- nNewEndX = nNewStartX - 1; // vor dem Feld
- else
- nNewStartX = nNewEndX + 1; // hinter dem Feld
- }
- else
- {
- SCCOL nThisCol = (SCCOL) nPosX; // absolute Spalte ( == Maus )
- if ( nThisCol < nPivotCol )
- {
- nNewEndX = nNewStartX - 1; // vor dem Feld
- bBefore = TRUE;
- }
- else if ( nThisCol > nPivotCol )
- {
- nNewStartX = nNewEndX + 1; // hinter dem Feld
- bBefore = FALSE;
- }
- else
- bNothing = TRUE;
- }
- SetPointer( Pointer( POINTER_PIVOT_ROW ) );
- }
- else
- {
- if (nRelY <= 0 && static_cast<SCsCOLROW>(nRelX) < static_cast<SCsCOLROW>(nColCount)+static_cast<SCsCOLROW>(nRowCount))
- {
- nDestRow = static_cast<SCsCOLROW>(nRelX) - static_cast<SCsCOLROW>(nColCount);
- bBefore = bMouseLeft;
- }
- else
- {
- nDestRow = nRelY-1;
- bBefore = bMouseTop;
- }
- if (nDestRow < 0)
- {
- nDestRow = 0;
- bBefore = TRUE;
- }
- if (nDestRow >= static_cast<SCsROW>(nRowCount))
- {
- nDestRow = static_cast<SCsROW>(nRowCount)-1;
- bBefore = FALSE;
- }
-
- nNewStartX = nPiCol1 + (SCCOL) nColCount;
- nNewEndX = nPiCol2 - 1;
- nNewStartY = nPiRow1 + nFilterAdd + nDestRow + nColRows;
- nNewEndY = nNewStartY;
- if ( bPivotColField ) // von der anderen Seite
- {
- if (bBefore)
- nNewEndY = nNewStartY - 1; // vor dem Feld
- else
- nNewStartY = nNewEndY + 1; // hinter dem Feld
- }
- else
- {
- SCCOL nThisCol =
- static_cast<SCCOL>(static_cast<SCCOLROW>(nDestRow) +
- static_cast<SCCOLROW>(nColCount) + nPiCol1);
- // absolute Spalte
- if ( nThisCol < nPivotCol )
- {
- bBefore = TRUE;
- nNewEndY = nNewStartY - 1; // vor dem Feld
- }
- else if ( nThisCol > nPivotCol )
- {
- bBefore = FALSE;
- nNewStartY = nNewEndY + 1; // hinter dem Feld
- }
- else
- bNothing = TRUE;
- }
- SetPointer( Pointer( POINTER_PIVOT_COL ) );
- }
-
- if (bMove)
- {
- if ( nNewStartX != nDragStartX || nNewEndX != nDragEndX ||
- nNewStartY != nDragStartY || nNewEndY != nDragEndY || !bDragRect )
- {
- //if (bDragRect)
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, FALSE );
-
- nDragStartX = nNewStartX;
- nDragStartY = nNewStartY;
- nDragEndX = nNewEndX;
- nDragEndY = nNewEndY;
- bDragRect = TRUE;
-
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, FALSE );
-
- UpdateDragRectOverlay();
- }
- }
- else
- {
- if (bDragRect)
- {
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, FALSE );
- bDragRect = FALSE;
- UpdateDragRectOverlay();
- }
-
- if (!bNothing)
- {
- SCSIZE nDestPos = bToCols ? static_cast<SCSIZE>(nDestCol) : static_cast<SCSIZE>(nDestRow);
- if (!bBefore)
- ++nDestPos;
- DoPivotDrop( FALSE, bToCols, nDestPos );
- }
- }
-
- bRet = TRUE;
- }
- else
- {
- if (bMove)
- SetPointer( Pointer( POINTER_PIVOT_DELETE ) );
- // if (bDragRect)
- // DrawDragRect( nDragStartX, nDragStartY, nDragEndX, nDragEndY, FALSE );
- bDragRect = FALSE;
- UpdateDragRectOverlay();
-
- if (!bMove)
- DoPivotDrop( TRUE, FALSE,0 );
- }
-
- if (bTimer && bMove)
- pViewData->GetView()->SetTimer( this, rMEvt ); // Event wiederholen
- else
- pViewData->GetView()->ResetTimer();
-
- return bRet;
-}
-
-void ScGridWindow::PivotMouseMove( const MouseEvent& rMEvt )
-{
- PivotTestMouse( rMEvt, TRUE );
-}
-
-void ScGridWindow::PivotMouseButtonUp( const MouseEvent& rMEvt )
-{
- bPivotMouse = FALSE; // als erstes, falls PivotTestMouse eine Fehlermeldung bringt
- ReleaseMouse();
-
- PivotTestMouse( rMEvt, FALSE );
- SetPointer( Pointer( POINTER_ARROW ) );
-}
-#endif
-
// -----------------------------------------------------------------------
//
// Data Pilot interaction
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index b90e5d3e802e..d700ee606731 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -2045,8 +2045,6 @@ void ScGridWindow::DataChanged( const DataChangedEvent& rDCEvt )
// RepeatResize in case scroll bar sizes have changed
pView->RepeatResize();
-
- pView->UpdateSelectionType();
pView->UpdateAllOverlays();
// invalidate cell attribs in input handler, in case the
diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk
index 9af8051b6613..466ab5dc8627 100644
--- a/sc/source/ui/view/makefile.mk
+++ b/sc/source/ui/view/makefile.mk
@@ -135,12 +135,10 @@ SLOFILES = \
$(SLO)$/viewfun4.obj \
$(SLO)$/viewfun2.obj
.ELIF "$(OS)$(COM)$(CPUNAME)"=="SOLARISC52INTEL"
-# tabcont can be removed if -xspace is no longer used (i99576, i99592)
NOOPTFILES=\
$(SLO)$/drawview.obj \
$(SLO)$/dbfunc2.obj \
- $(SLO)$/tabvwsh2.obj \
- $(SLO)$/tabcont.obj
+ $(SLO)$/tabvwsh2.obj
.ELSE
NOOPTFILES=\
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index b600600acb6b..9d2da303988c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1816,6 +1816,7 @@ void ScOutputData::FindChanged()
pDoc->DisableIdle( bWasIdleDisabled );
}
+#ifdef OLD_SELECTION_PAINT
void ScOutputData::DrawMark( Window* pWin )
{
Rectangle aRect;
@@ -1826,14 +1827,14 @@ void ScOutputData::DrawMark( Window* pWin )
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- if ( pThisRowInfo->bChanged )
+ if (pThisRowInfo->bChanged)
{
long nPosX = nScrX;
- if ( bLayoutRTL )
+ if (bLayoutRTL)
nPosX += nMirrorW - 1; // always in pixels
aRect = Rectangle( Point( nPosX,nPosY ), Size(1, pThisRowInfo->nHeight) );
- if ( bLayoutRTL )
+ if (bLayoutRTL)
aRect.Left() = aRect.Right() + 1;
else
aRect.Right() = aRect.Left() - 1;
@@ -1841,12 +1842,12 @@ void ScOutputData::DrawMark( Window* pWin )
BOOL bOldMarked = FALSE;
for (SCCOL nX=nX1; nX<=nX2; nX++)
{
- if ( pThisRowInfo->pCellInfo[nX+1].bMarked != bOldMarked )
+ if (pThisRowInfo->pCellInfo[nX+1].bMarked != bOldMarked)
{
if (bOldMarked && aRect.Right() >= aRect.Left())
aInvert.AddRect( aRect );
- if ( bLayoutRTL )
+ if (bLayoutRTL)
aRect.Right() = nPosX;
else
aRect.Left() = nPosX;
@@ -1854,7 +1855,7 @@ void ScOutputData::DrawMark( Window* pWin )
bOldMarked = pThisRowInfo->pCellInfo[nX+1].bMarked;
}
- if ( bLayoutRTL )
+ if (bLayoutRTL)
{
nPosX -= pRowInfo[0].pCellInfo[nX+1].nWidth;
aRect.Left() = nPosX+1;
@@ -1871,6 +1872,7 @@ void ScOutputData::DrawMark( Window* pWin )
nPosY += pThisRowInfo->nHeight;
}
}
+#endif
void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
SCCOL nRefEndX, SCROW nRefEndY,
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index e41bd4941d9c..f5688171b145 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -94,7 +94,6 @@ const USHORT SC_SHRINKAGAIN_MAX = 7;
class ScDrawStringsVars
{
ScOutputData* pOutput; // Verbindung
- SvNumberFormatter* pFormatter;
const ScPatternAttr* pPattern; // Attribute
const SfxItemSet* pCondSet; // aus bedingter Formatierung
@@ -187,8 +186,6 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, BOOL bPTL) :
bShrink ( FALSE ),
bPixelToLogic( bPTL )
{
- pFormatter = pData->pDoc->GetFormatTable();
-
ScModule* pScMod = SC_MOD();
// #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
bCellContrast = pOutput->bUseStyleColor &&
@@ -373,7 +370,7 @@ void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet*
// Zahlenformat
// ULONG nOld = nValueFormat;
- nValueFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
+ nValueFormat = pPattern->GetNumberFormat( pOutput->pDoc->GetFormatTable(), pCondSet );
/* s.u.
if (nValueFormat != nOld)
@@ -414,7 +411,7 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt
const SfxPoolItem* pLangItem;
if ( !pCondSet || pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT,TRUE,&pLangItem) != SFX_ITEM_SET )
pLangItem = &pPattern->GetItem(ATTR_LANGUAGE_FORMAT);
- nValueFormat = pFormatter->GetFormatForLanguageIfBuiltIn(
+ nValueFormat = pOutput->pDoc->GetFormatTable()->GetFormatForLanguageIfBuiltIn(
((SfxUInt32Item*)pFormItem)->GetValue(),
((SvxLanguageItem*)pLangItem)->GetLanguage() );
@@ -456,7 +453,7 @@ BOOL ScDrawStringsVars::SetText( ScBaseCell* pCell )
ULONG nFormat = GetValueFormat();
ScCellFormat::GetString( pCell,
nFormat, aString, &pColor,
- *pFormatter,
+ *pOutput->pDoc->GetFormatTable(),
pOutput->bShowNullValues,
pOutput->bShowFormulas,
ftCheck );
@@ -1358,11 +1355,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
}
if (bDoCell && !bNeedEdit)
{
- if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+ BOOL bFormulaCell = (pCell->GetCellType() == CELLTYPE_FORMULA );
+ if ( bFormulaCell )
lcl_CreateInterpretProgress( bProgress, pDoc, (ScFormulaCell*)pCell );
if ( aVars.SetText(pCell) )
pOldPattern = NULL;
- bNeedEdit = aVars.HasEditCharacters();
+ bNeedEdit = aVars.HasEditCharacters() ||
+ (bFormulaCell && ((ScFormulaCell*)pCell)->IsMultilineResult());
}
if (bDoCell && !bNeedEdit)
{
@@ -1914,8 +1913,6 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
Size aMinSize = pRefDevice->PixelToLogic(Size(0,100)); // erst darueber wird ausgegeben
// UINT32 nMinHeight = aMinSize.Height() / 200; // 1/2 Pixel
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
-
ScModule* pScMod = SC_MOD();
sal_Int32 nConfBackColor = pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
// #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
@@ -2319,12 +2316,12 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
else
{
ULONG nFormat = pPattern->GetNumberFormat(
- pFormatter, pCondSet );
+ pDoc->GetFormatTable(), pCondSet );
String aString;
Color* pColor;
ScCellFormat::GetString( pCell,
nFormat,aString, &pColor,
- *pFormatter,
+ *pDoc->GetFormatTable(),
bShowNullValues,
bShowFormulas,
ftCheck );
@@ -2810,8 +2807,6 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
nRotMax = pRowInfo[nRotY].nRotMaxCol;
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
-
ScModule* pScMod = SC_MOD();
sal_Int32 nConfBackColor = pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
// #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
@@ -3100,12 +3095,12 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
else
{
ULONG nFormat = pPattern->GetNumberFormat(
- pFormatter, pCondSet );
+ pDoc->GetFormatTable(), pCondSet );
String aString;
Color* pColor;
ScCellFormat::GetString( pCell,
nFormat,aString, &pColor,
- *pFormatter,
+ *pDoc->GetFormatTable(),
bShowNullValues,
bShowFormulas,
ftCheck );
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 3bfb8729cd37..db1a8952aeef 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -49,6 +49,7 @@
#include "sc.hrc"
#include "globstr.hrc"
#include "transobj.hxx"
+#include "clipparam.hxx"
// STATIC DATA -----------------------------------------------------------
@@ -447,7 +448,8 @@ void ScTabControl::DoDrag( const Region& /* rRegion */ )
aTabMark.SetMarkArea( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) );
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
- pDoc->CopyToClip( 0,0, MAXCOL,MAXROW, FALSE, pClipDoc, FALSE, &aTabMark );
+ ScClipParam aClipParam(ScRange(0, 0, 0, MAXCOL, MAXROW, 0), false);
+ pDoc->CopyToClip(aClipParam, pClipDoc, &aTabMark, false);
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index c51c81c36dd8..3077e852dbaf 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -384,8 +384,7 @@ BOOL lcl_HasRowOutline( const ScViewData& rViewData )
bInActivatePart( FALSE ), \
bInZoomUpdate( FALSE ), \
bMoveIsShift( FALSE ), \
- bNewStartIfMarking( FALSE ), \
- bOldSelection( FALSE )
+ bNewStartIfMarking( FALSE )
ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
@@ -398,22 +397,22 @@ ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pView
Init();
}
-ScTabView::ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell ) :
- pFrameWin( pParent ),
- aViewData( rScTabView.aViewData ),
- TABVIEW_INIT
-{
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabView::ScTabView" );
-
- aViewData.SetViewShell( pViewShell );
- Init();
-
- UpdateShow();
- if ( aViewData.GetActivePart() != SC_SPLIT_BOTTOMLEFT )
- pGridWin[SC_SPLIT_BOTTOMLEFT]->Show();
-
- InvalidateSplit();
-}
+//UNUSED2009-05 ScTabView::ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell ) :
+//UNUSED2009-05 pFrameWin( pParent ),
+//UNUSED2009-05 aViewData( rScTabView.aViewData ),
+//UNUSED2009-05 TABVIEW_INIT
+//UNUSED2009-05 {
+//UNUSED2009-05 RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabView::ScTabView" );
+//UNUSED2009-05
+//UNUSED2009-05 aViewData.SetViewShell( pViewShell );
+//UNUSED2009-05 Init();
+//UNUSED2009-05
+//UNUSED2009-05 UpdateShow();
+//UNUSED2009-05 if ( aViewData.GetActivePart() != SC_SPLIT_BOTTOMLEFT )
+//UNUSED2009-05 pGridWin[SC_SPLIT_BOTTOMLEFT]->Show();
+//UNUSED2009-05
+//UNUSED2009-05 InvalidateSplit();
+//UNUSED2009-05 }
void ScTabView::InitScrollBar( ScrollBar& rScrollBar, long nMaxVal )
{
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 608658024d2b..a19760e4c277 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -422,7 +422,7 @@ void ScTabView::SelectionChanged()
rBindings.Invalidate( SID_CUT );
rBindings.Invalidate( SID_COPY );
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( FID_PASTE_CONTENTS );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( FID_INS_ROW );
rBindings.Invalidate( FID_INS_COLUMN );
@@ -466,19 +466,9 @@ void ScTabView::CursorPosChanged()
// Broadcast, damit andere Views des Dokuments auch umschalten
ScDocument* pDoc = aViewData.GetDocument();
-#if OLD_PIVOT_IMPLEMENTATION
- BOOL bPivot = ( NULL != pDoc->GetPivotAtCursor( aViewData.GetCurX(),
- aViewData.GetCurY(),
- aViewData.GetTabNo() ) ||
- NULL != pDoc->GetDPAtCursor( aViewData.GetCurX(),
- aViewData.GetCurY(),
- aViewData.GetTabNo() ) );
- aViewData.GetViewShell()->SetPivotShell(bPivot);
-#else
bool bDP = NULL != pDoc->GetDPAtCursor(
aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo() );
aViewData.GetViewShell()->SetPivotShell(bDP);
-#endif
// UpdateInputHandler jetzt in CellContentChanged
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index c27524c83542..75e961d5eeec 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -148,16 +148,6 @@ void __EXPORT ScTabView::Init()
// Das gilt auch fuer ViewOptionsHasChanged()
TestHintWindow();
-
- UpdateSelectionType();
-}
-
-void ScTabView::UpdateSelectionType()
-{
- // old selection in high contrast mode, or if transparent drawing isn't supported
-
- bOldSelection = pFrameWin->GetSettings().GetStyleSettings().GetHighContrastMode() ||
- !pFrameWin->supportsOperation( OutDevSupport_TransparentRect );
}
__EXPORT ScTabView::~ScTabView()
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index d8449ebc3699..e34741ba4c6b 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1510,7 +1510,7 @@ BOOL ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
// #51889# Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung
// (Slot ist disabled, SfxViewShell::KeyInput wuerde also kommentarlos verschluckt)
KeyFuncType eFunc = aCode.GetFunction();
- if ( eFunc == KEYFUNC_COPY || eFunc == KEYFUNC_CUT )
+ if ( eFunc == KEYFUNC_CUT )
{
ScRange aDummy;
ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy );
@@ -1806,7 +1806,7 @@ void ScTabViewShell::Construct( BYTE nForceDesignMode )
{
SCTAB nInitTabCount = 3; //! konfigurierbar !!!
for (SCTAB i=1; i<nInitTabCount; i++)
- pDoc->MakeTable(i);
+ pDoc->MakeTable(i,false);
}
pDocSh->SetEmpty( FALSE ); // #i6232# make sure this is done only once
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 766785d5ffc8..9e844f970909 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -72,11 +72,23 @@
#include "compiler.hxx"
-BOOL ScTabViewShell::GetFunction( String& rFuncStr )
+BOOL ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode )
{
String aStr;
ScSubTotalFunc eFunc = (ScSubTotalFunc) SC_MOD()->GetAppOptions().GetStatusFunc();
+ ScViewData* pViewData = GetViewData();
+ ScMarkData& rMark = pViewData->GetMarkData();
+ bool bIgnoreError = (rMark.IsMarked() || rMark.IsMultiMarked());
+
+ if (bIgnoreError && (eFunc == SUBTOTAL_FUNC_CNT || eFunc == SUBTOTAL_FUNC_CNT2))
+ nErrCode = 0;
+
+ if (nErrCode)
+ {
+ rFuncStr = ScGlobal::GetLongErrorString(nErrCode);
+ return true;
+ }
USHORT nGlobStrId = 0;
switch (eFunc)
@@ -94,9 +106,7 @@ BOOL ScTabViewShell::GetFunction( String& rFuncStr )
}
if (nGlobStrId)
{
- ScViewData* pViewData = GetViewData();
ScDocument* pDoc = pViewData->GetDocument();
- ScMarkData& rMark = pViewData->GetMarkData();
SCCOL nPosX = pViewData->GetCurX();
SCROW nPosY = pViewData->GetCurY();
SCTAB nTab = pViewData->GetTabNo();
@@ -104,30 +114,38 @@ BOOL ScTabViewShell::GetFunction( String& rFuncStr )
aStr = ScGlobal::GetRscString(nGlobStrId);
aStr += '=';
- // Anzahl im Standardformat, die anderen nach Cursorposition
- sal_uInt32 nNumFmt = 0;
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
- if ( eFunc != SUBTOTAL_FUNC_CNT && eFunc != SUBTOTAL_FUNC_CNT2 )
- {
- // Zahlformat aus Attributen oder Formel
- pDoc->GetNumberFormat( nPosX, nPosY, nTab, nNumFmt );
- if ( (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0 )
- {
- ScBaseCell* pCell;
- pDoc->GetCell( nPosX, nPosY, nTab, pCell );
- if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
- nNumFmt = ((ScFormulaCell*)pCell)->GetStandardFormat(
- *pFormatter, nNumFmt );
- }
- }
ScAddress aCursor( nPosX, nPosY, nTab );
double nVal;
if ( pDoc->GetSelectionFunction( eFunc, aCursor, rMark, nVal ) )
{
- String aValStr;
- Color* pDummy;
- pFormatter->GetOutputString( nVal, nNumFmt, aValStr, &pDummy );
- aStr += aValStr;
+ if ( nVal == 0.0 )
+ aStr += '0';
+ else
+ {
+ // Anzahl im Standardformat, die anderen nach Cursorposition
+ SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ sal_uInt32 nNumFmt = 0;
+ if ( eFunc != SUBTOTAL_FUNC_CNT && eFunc != SUBTOTAL_FUNC_CNT2 )
+ {
+ // Zahlformat aus Attributen oder Formel
+ pDoc->GetNumberFormat( nPosX, nPosY, nTab, nNumFmt );
+ if ( (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0 )
+ {
+ ScBaseCell* pCell;
+ pDoc->GetCell( nPosX, nPosY, nTab, pCell );
+ if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
+ {
+
+ nNumFmt = ((ScFormulaCell*)pCell)->GetStandardFormat(*pFormatter, nNumFmt );
+ }
+ }
+ }
+
+ String aValStr;
+ Color* pDummy;
+ pFormatter->GetOutputString( nVal, nNumFmt, aValStr, &pDummy );
+ aStr += aValStr;
+ }
}
rFuncStr = aStr;
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index f2bc65a66ba8..37dc2c11da7f 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -465,7 +465,10 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
case SID_INSERT_SOUND:
case SID_INSERT_VIDEO:
- if ( bOle || bTabProt || !SvxPluginFileDlg::IsAvailable(nWhich) || bShared )
+ /* #i102735# discussed with NN: removed for performance reasons
+ || !SvxPluginFileDlg::IsAvailable(nWhich)
+ */
+ if ( bOle || bTabProt || bShared )
rSet.DisableItem( nWhich );
break;
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 9dda9a097395..3065aa2fd4e1 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -212,6 +212,7 @@
#include "transobj.hxx"
#include "drwtrans.hxx"
#include "docuno.hxx"
+#include "clipparam.hxx"
using namespace com::sun::star;
@@ -312,10 +313,10 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
ScRange aRange;
ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange );
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ ScMarkData& rMark = GetViewData()->GetMarkData();
if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
if ( !pDoc->HasSelectedBlockMatrixFragment(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
@@ -342,9 +343,8 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) );
}
- pDoc->CopyToClip( aRange.aStart.Col(), aRange.aStart.Row(),
- aRange.aEnd.Col(), aRange.aEnd.Row(),
- bCut, pClipDoc, FALSE, &rMark, FALSE, bIncludeObjects );
+ ScClipParam aClipParam(aRange, bCut);
+ pDoc->CopyToClip(aClipParam, pClipDoc, &rMark, false, false, bIncludeObjects);
if (bSysClip)
{
ScDrawLayer::SetGlobalDrawPersist(NULL);
@@ -382,6 +382,124 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
ErrorMessage(STR_MATRIXFRAGMENTERR);
}
}
+ else if (eMarkType == SC_MARK_MULTI)
+ {
+ bool bSuccess = false;
+ ScClipParam aClipParam;
+ aClipParam.mbCutMode = false;
+ rMark.MarkToSimple();
+ rMark.FillRangeListWithMarks(&aClipParam.maRanges, false);
+
+ do
+ {
+ if (bCut)
+ // We con't support cutting of multi-selections.
+ break;
+
+ if (pClipDoc)
+ // TODO: What's this for?
+ break;
+
+ ::std::auto_ptr<ScDocument> pDocClip(new ScDocument(SCDOCMODE_CLIP));
+
+ // Check for geometrical feasibility of the ranges.
+ bool bValidRanges = true;
+ ScRangePtr p = aClipParam.maRanges.First();
+ SCCOL nPrevColDelta = 0;
+ SCROW nPrevRowDelta = 0;
+ SCCOL nPrevCol = p->aStart.Col();
+ SCROW nPrevRow = p->aStart.Row();
+ SCCOL nPrevColSize = p->aEnd.Col() - p->aStart.Col() + 1;
+ SCROW nPrevRowSize = p->aEnd.Row() - p->aStart.Row() + 1;
+ for (p = aClipParam.maRanges.Next(); p; p = aClipParam.maRanges.Next())
+ {
+ if (pDoc->HasSelectedBlockMatrixFragment(
+ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), rMark))
+ {
+ if (!bApi)
+ ErrorMessage(STR_MATRIXFRAGMENTERR);
+ return false;
+ }
+
+ SCCOL nColDelta = p->aStart.Col() - nPrevCol;
+ SCROW nRowDelta = p->aStart.Row() - nPrevRow;
+
+ if ((nColDelta && nRowDelta) || (nPrevColDelta && nRowDelta) || (nPrevRowDelta && nColDelta))
+ {
+ bValidRanges = false;
+ break;
+ }
+
+ if (aClipParam.meDirection == ScClipParam::Unspecified)
+ {
+ if (nColDelta)
+ aClipParam.meDirection = ScClipParam::Column;
+ if (nRowDelta)
+ aClipParam.meDirection = ScClipParam::Row;
+ }
+
+ SCCOL nColSize = p->aEnd.Col() - p->aStart.Col() + 1;
+ SCROW nRowSize = p->aEnd.Row() - p->aStart.Row() + 1;
+
+ if (aClipParam.meDirection == ScClipParam::Column && nRowSize != nPrevRowSize)
+ {
+ // column-oriented ranges must have identical row size.
+ bValidRanges = false;
+ break;
+ }
+ if (aClipParam.meDirection == ScClipParam::Row && nColSize != nPrevColSize)
+ {
+ // likewise, row-oriented ranges must have identical
+ // column size.
+ bValidRanges = false;
+ break;
+ }
+
+ nPrevCol = p->aStart.Col();
+ nPrevRow = p->aStart.Row();
+ nPrevColDelta = nColDelta;
+ nPrevRowDelta = nRowDelta;
+ nPrevColSize = nColSize;
+ nPrevRowSize = nRowSize;
+ }
+ if (!bValidRanges)
+ break;
+
+ pDoc->CopyToClip(aClipParam, pDocClip.get(), &rMark, false, false, bIncludeObjects);
+
+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ if ( pChangeTrack )
+ pChangeTrack->ResetLastCut(); // kein CutMode mehr
+
+ {
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ TransferableObjectDescriptor aObjDesc;
+ pDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+ // maSize is set in ScTransferObj ctor
+
+ ScTransferObj* pTransferObj = new ScTransferObj( pDocClip.release(), aObjDesc );
+ uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+
+ if ( ScGlobal::pDrawClipDocShellRef )
+ {
+ SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) );
+ pTransferObj->SetDrawPersist( aPersistRef ); // keep persist for ole objects alive
+ }
+
+ pTransferObj->CopyToClipboard( GetActiveWin() ); // system clipboard
+ SC_MOD()->SetClipObject( pTransferObj, NULL ); // internal clipboard
+ }
+
+ bSuccess = true;
+ }
+ while (false);
+
+ if (!bSuccess && !bApi)
+ ErrorMessage(STR_NOMULTISELECT);
+
+ bDone = bSuccess;
+ }
else
{
if (!bApi)
@@ -408,9 +526,8 @@ ScTransferObj* ScViewFunc::CopyToTransferable()
BOOL bAnyOle = pDoc->HasOLEObjectsInArea( aRange, &rMark );
ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) );
- pDoc->CopyToClip( aRange.aStart.Col(), aRange.aStart.Row(),
- aRange.aEnd.Col(), aRange.aEnd.Row(),
- FALSE, pClipDoc, FALSE, &rMark, FALSE, TRUE );
+ ScClipParam aClipParam(aRange, false);
+ pDoc->CopyToClip(aClipParam, pClipDoc, &rMark, false, false, true);
ScDrawLayer::SetGlobalDrawPersist(NULL);
pClipDoc->ExtendMerge( aRange, TRUE );
@@ -739,6 +856,52 @@ BOOL lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
// internes Paste
+namespace {
+
+class CursorSwitcher
+{
+public:
+ CursorSwitcher(ScViewFunc* pViewFunc) :
+ mpViewFunc(pViewFunc)
+ {
+ mpViewFunc->HideCursor();
+ }
+
+ ~CursorSwitcher()
+ {
+ mpViewFunc->ShowCursor();
+ }
+private:
+ ScViewFunc* mpViewFunc;
+};
+
+bool lcl_checkDestRangeForOverwrite(const ScRange& rDestRange, const ScDocument* pDoc, const ScMarkData& rMark, Window* pParentWnd)
+{
+ bool bIsEmpty = true;
+ SCTAB nTabCount = pDoc->GetTableCount();
+ for (SCTAB nTab=0; nTab < nTabCount && bIsEmpty; ++nTab)
+ {
+ if (!rMark.GetTableSelect(nTab))
+ continue;
+
+ bIsEmpty = pDoc->IsBlockEmpty(nTab, rDestRange.aStart.Col(), rDestRange.aStart.Row(),
+ rDestRange.aEnd.Col(), rDestRange.aEnd.Row());
+ }
+
+ if (!bIsEmpty)
+ {
+ ScReplaceWarnBox aBox(pParentWnd);
+ if (aBox.Execute() != RET_YES)
+ {
+ // changing the configuration is within the ScReplaceWarnBox
+ return false;
+ }
+ }
+ return true;
+}
+
+}
+
BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
USHORT nFunction, BOOL bSkipEmpty,
BOOL bTranspose, BOOL bAsLink,
@@ -764,6 +927,12 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
// do not copy note captions into undo document
nUndoFlags |= IDF_NOCAPTIONS;
+ ScClipParam& rClipParam = pClipDoc->GetClipParam();
+ if (rClipParam.isMultiRange())
+ return PasteMultiRangesFromClip(
+ nFlags, pClipDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, bAllowDialogs,
+ eMoveMode, nContFlags, nUndoFlags);
+
BOOL bCutMode = pClipDoc->IsCutMode(); // if transposing, take from original clipdoc
BOOL bIncludeFiltered = bCutMode;
@@ -992,23 +1161,8 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
if ( bAskIfNotEmpty )
{
- BOOL bIsEmpty = TRUE;
- SCTAB nTabCount = pDoc->GetTableCount();
- for (SCTAB nTab=0; nTab<nTabCount && bIsEmpty; nTab++)
- if ( aFilteredMark.GetTableSelect(nTab) &&
- !pDoc->IsBlockEmpty( nTab, aUserRange.aStart.Col(), aUserRange.aStart.Row(),
- aUserRange.aEnd.Col(), aUserRange.aEnd.Row() ) )
- bIsEmpty = FALSE;
-
- if ( !bIsEmpty )
- {
- ScReplaceWarnBox aBox( GetViewData()->GetDialogParent() );
- if ( aBox.Execute() != RET_YES )
- {
- // changing the configuration is within the ScReplaceWarnBox
- return FALSE;
- }
- }
+ if (!lcl_checkDestRangeForOverwrite(aUserRange, pDoc, aFilteredMark, GetViewData()->GetDialogParent()))
+ return false;
}
}
@@ -1302,7 +1456,179 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
// AdjustBlockHeight has already been called above
aModificator.SetDocumentModified();
- pDocSh->UpdateOle(GetViewData());
+ PostPasteFromClip(aUserRange, rMark);
+ return TRUE;
+}
+
+bool ScViewFunc::PasteMultiRangesFromClip(
+ sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+ bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
+ InsCellCmd eMoveMode, sal_uInt16 /*nContFlags*/, sal_uInt16 nUndoFlags)
+{
+ ScViewData& rViewData = *GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScMarkData aMark(rViewData.GetMarkData());
+ const ScAddress& rCurPos = rViewData.GetCurPos();
+ ScClipParam& rClipParam = pClipDoc->GetClipParam();
+ SCCOL nColSize = rClipParam.getPasteColSize();
+ SCROW nRowSize = rClipParam.getPasteRowSize();
+
+ if (bTranspose)
+ {
+ if (static_cast<SCROW>(rCurPos.Col()) + nRowSize-1 > static_cast<SCROW>(MAXCOL))
+ {
+ ErrorMessage(STR_PASTE_FULL);
+ return false;
+ }
+
+ ::std::auto_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP));
+ pClipDoc->TransposeClip(pTransClip.get(), nFlags, bAsLink);
+ pClipDoc = pTransClip.release();
+ SCCOL nTempColSize = nColSize;
+ nColSize = static_cast<SCCOL>(nRowSize);
+ nRowSize = static_cast<SCROW>(nTempColSize);
+ }
+
+ if (!ValidCol(rCurPos.Col()+nColSize-1) || !ValidRow(rCurPos.Row()+nRowSize-1))
+ {
+ ErrorMessage(STR_PASTE_FULL);
+ return false;
+ }
+
+ // Determine the first and last selected sheet numbers.
+ SCTAB nTab1 = aMark.GetFirstSelected();
+ SCTAB nTab2 = nTab1;
+ for (SCTAB i = nTab1+1; i <= MAXTAB; ++i)
+ if (aMark.GetTableSelect(i))
+ nTab2 = i;
+
+ ScDocShellModificator aModificator(*pDocSh);
+
+ // For multi-selection paste, we don't support cell duplication for larger
+ // destination range. In case the destination is marked, we reset it to
+ // the clip size.
+ ScRange aMarkedRange(rCurPos.Col(), rCurPos.Row(), nTab1,
+ rCurPos.Col()+nColSize-1, rCurPos.Row()+nRowSize-1, nTab2);
+
+ // Extend the marked range to account for filtered rows in the destination
+ // area.
+ if (ScViewUtil::HasFiltered(aMarkedRange, pDoc))
+ {
+ if (!ScViewUtil::FitToUnfilteredRows(aMarkedRange, pDoc, nRowSize))
+ return false;
+ }
+
+ bool bAskIfNotEmpty =
+ bAllowDialogs && (nFlags & IDF_CONTENTS) &&
+ nFunction == PASTE_NOFUNC && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
+
+ if (bAskIfNotEmpty)
+ {
+ if (!lcl_checkDestRangeForOverwrite(aMarkedRange, pDoc, aMark, rViewData.GetDialogParent()))
+ return false;
+ }
+
+ aMark.SetMarkArea(aMarkedRange);
+ MarkRange(aMarkedRange);
+
+ bool bInsertCells = (eMoveMode != INS_NONE);
+ if (bInsertCells)
+ {
+ if (!InsertCells(eMoveMode, pDoc->IsUndoEnabled(), true))
+ return false;
+ }
+
+ ::std::auto_ptr<ScDocument> pUndoDoc;
+ if (pDoc->IsUndoEnabled())
+ {
+ pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO));
+ pUndoDoc->InitUndoSelected(pDoc, aMark, false, false);
+ pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, pUndoDoc.get(), &aMark, true);
+ }
+
+ ::std::auto_ptr<ScDocument> pMixDoc;
+ if ( bSkipEmpty || nFunction )
+ {
+ if ( nFlags & IDF_CONTENTS )
+ {
+ pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO));
+ pMixDoc->InitUndoSelected(pDoc, aMark, false, false);
+ pDoc->CopyToDocument(aMarkedRange, IDF_CONTENTS, false, pMixDoc.get(), &aMark, true);
+ }
+ }
+
+ /* Make draw layer and start drawing undo.
+ - Needed before AdjustBlockHeight to track moved drawing objects.
+ - Needed before pDoc->CopyFromClip to track inserted note caption objects.
+ */
+ if (nFlags & IDF_OBJECTS)
+ pDocSh->MakeDrawLayer();
+ if (pDoc->IsUndoEnabled())
+ pDoc->BeginDrawUndo();
+
+ CursorSwitcher aCursorSwitch(this);
+ sal_uInt16 nNoObjFlags = nFlags & ~IDF_OBJECTS;
+ pDoc->CopyMultiRangeFromClip(rCurPos, aMark, nNoObjFlags, pClipDoc,
+ true, bAsLink, false, bSkipEmpty);
+
+ if (pMixDoc.get())
+ pDoc->MixDocument(aMarkedRange, nFunction, bSkipEmpty, pMixDoc.get());
+
+ AdjustBlockHeight(); // update row heights before pasting objects
+
+ if (nFlags & IDF_OBJECTS)
+ {
+ // Paste the drawing objects after the row heights have been updated.
+ pDoc->CopyMultiRangeFromClip(rCurPos, aMark, IDF_OBJECTS, pClipDoc,
+ true, false, false, true);
+ }
+
+ pDocSh->PostPaint(
+ aMarkedRange.aStart.Col(), aMarkedRange.aStart.Row(), nTab1,
+ aMarkedRange.aEnd.Col(), aMarkedRange.aEnd.Row(), nTab1, PAINT_GRID);
+
+ if (pDoc->IsUndoEnabled())
+ {
+ SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+ String aUndo = ScGlobal::GetRscString(
+ pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY);
+ pUndoMgr->EnterListAction(aUndo, aUndo);
+
+ ScUndoPasteOptions aOptions; // store options for repeat
+ aOptions.nFunction = nFunction;
+ aOptions.bSkipEmpty = bSkipEmpty;
+ aOptions.bTranspose = bTranspose;
+ aOptions.bAsLink = bAsLink;
+ aOptions.eMoveMode = eMoveMode;
+
+ ScUndoPaste* pUndo = new ScUndoPaste(pDocSh,
+ aMarkedRange.aStart.Col(),
+ aMarkedRange.aStart.Row(),
+ aMarkedRange.aStart.Tab(),
+ aMarkedRange.aEnd.Col(),
+ aMarkedRange.aEnd.Row(),
+ aMarkedRange.aEnd.Tab(),
+ aMark, pUndoDoc.release(), NULL, nFlags|nUndoFlags, NULL, NULL, NULL, NULL, false, &aOptions);
+
+ if (bInsertCells)
+ pUndoMgr->AddUndoAction(new ScUndoWrapper(pUndo), true);
+ else
+ pUndoMgr->AddUndoAction(pUndo, false);
+
+ pUndoMgr->LeaveListAction();
+ }
+ aModificator.SetDocumentModified();
+ PostPasteFromClip(aMarkedRange, aMark);
+ return true;
+}
+
+void ScViewFunc::PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark)
+{
+ ScViewData* pViewData = GetViewData();
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocument* pDoc = pViewData->GetDocument();
+ pDocSh->UpdateOle(pViewData);
SelectionChanged();
@@ -1316,7 +1642,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
{
if ( rMark.GetTableSelect( i ) )
{
- ScRange aChangeRange( aUserRange );
+ ScRange aChangeRange(rPasteRange);
aChangeRange.aStart.SetTab( i );
aChangeRange.aEnd.SetTab( i );
aChangeRanges.Append( aChangeRange );
@@ -1324,8 +1650,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
}
pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aChangeRanges );
}
-
- return TRUE;
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 0f3a1c812802..578f6c1fe733 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -155,7 +155,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL|IDF_NOCAPTIONS, FALSE, pRedoDoc );
ScMarkData aDestMark;
aDestMark.SelectOneTable( nTab );
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index f8b89a85e11c..35af3ee2a2e3 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -79,6 +79,7 @@
#include "asciiopt.hxx"
#include "scabstdlg.hxx"
+#include "clipparam.hxx"
#include <vcl/msgbox.hxx>
#include <sfx2/viewfrm.hxx>
#include <svx/dbaexchange.hxx>
@@ -163,12 +164,12 @@ BOOL ScViewFunc::PasteDataFormat( ULONG nFormatId,
if ( pSrcDoc->GetDataStart( nSrcTab, nFirstCol, nFirstRow ) )
pSrcDoc->GetCellArea( nSrcTab, nLastCol, nLastRow );
else
- {
+ {
nFirstCol = nLastCol = 0;
nFirstRow = nLastRow = 0;
- }
- pSrcDoc->CopyToClip( nFirstCol, nFirstRow, nLastCol, nLastRow,
- FALSE, pClipDoc, FALSE, &aSrcMark );
+ }
+ ScClipParam aClipParam(ScRange(nFirstCol, nFirstRow, 0, nLastCol, nLastRow, 0), false);
+ pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aSrcMark);
ScGlobal::SetClipDocName( xDocShRef->GetTitle( SFX_TITLE_FULLNAME ) );
SetCursor( nPosX, nPosY );
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 83dd05c9d33c..d0a6f2acf015 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -481,12 +481,13 @@ BOOL ScUpdateRect::GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
return TRUE;
}
+#ifdef OLD_SELECTION_PAINT
BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, BOOL& rCont )
{
rCont = FALSE;
- if ( nNewStartX == nOldStartX && nNewEndX == nOldEndX &&
- nNewStartY == nOldStartY && nNewEndY == nOldEndY )
+ if (nNewStartX == nOldStartX && nNewEndX == nOldEndX &&
+ nNewStartY == nOldStartY && nNewEndY == nOldEndY)
{
rX1 = nNewStartX;
rY1 = nNewStartY;
@@ -500,14 +501,14 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
rX2 = Max(nNewEndX,nOldEndX);
rY2 = Max(nNewEndY,nOldEndY);
- if ( nNewStartX == nOldStartX && nNewEndX == nOldEndX ) // nur vertikal
+ if (nNewStartX == nOldStartX && nNewEndX == nOldEndX) // nur vertikal
{
- if ( nNewStartY == nOldStartY )
+ if (nNewStartY == nOldStartY)
{
rY1 = Min( nNewEndY, nOldEndY ) + 1;
rY2 = Max( nNewEndY, nOldEndY );
}
- else if ( nNewEndY == nOldEndY )
+ else if (nNewEndY == nOldEndY)
{
rY1 = Min( nNewStartY, nOldStartY );
rY2 = Max( nNewStartY, nOldStartY ) - 1;
@@ -523,14 +524,14 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
nContX2 = rX2;
}
}
- else if ( nNewStartY == nOldStartY && nNewEndY == nOldEndY ) // nur horizontal
+ else if (nNewStartY == nOldStartY && nNewEndY == nOldEndY) // nur horizontal
{
- if ( nNewStartX == nOldStartX )
+ if (nNewStartX == nOldStartX)
{
rX1 = Min( nNewEndX, nOldEndX ) + 1;
rX2 = Max( nNewEndX, nOldEndX );
}
- else if ( nNewEndX == nOldEndX )
+ else if (nNewEndX == nOldEndX)
{
rX1 = Min( nNewStartX, nOldStartX );
rX2 = Max( nNewStartX, nOldStartX ) - 1;
@@ -546,9 +547,9 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
nContY2 = rY2;
}
}
- else if ( nNewEndX == nOldEndX && nNewEndY == nOldEndY ) // links oben
+ else if (nNewEndX == nOldEndX && nNewEndY == nOldEndY) // links oben
{
- if ( (nNewStartX<nOldStartX) == (nNewStartY<nOldStartY) )
+ if ((nNewStartX<nOldStartX) == (nNewStartY<nOldStartY))
rX1 = Min( nNewStartX, nOldStartX );
else
rX1 = Max( nNewStartX, nOldStartX ); // Ecke weglassen
@@ -561,9 +562,9 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
nContX1 = Min( nNewStartX, nOldStartX ); // links
nContX2 = Max( nNewStartX, nOldStartX ) - 1;
}
- else if ( nNewStartX == nOldStartX && nNewEndY == nOldEndY ) // rechts oben
+ else if (nNewStartX == nOldStartX && nNewEndY == nOldEndY) // rechts oben
{
- if ( (nNewEndX<nOldEndX) != (nNewStartY<nOldStartY) )
+ if ((nNewEndX<nOldEndX) != (nNewStartY<nOldStartY))
rX2 = Max( nNewEndX, nOldEndX );
else
rX2 = Min( nNewEndX, nOldEndX ); // Ecke weglassen
@@ -576,9 +577,9 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
nContX1 = Min( nNewEndX, nOldEndX ) + 1; // rechts
nContX2 = Max( nNewEndX, nOldEndX );
}
- else if ( nNewEndX == nOldEndX && nNewStartY == nOldStartY ) // links unten
+ else if (nNewEndX == nOldEndX && nNewStartY == nOldStartY) // links unten
{
- if ( (nNewStartX<nOldStartX) != (nNewEndY<nOldEndY) )
+ if ((nNewStartX<nOldStartX) != (nNewEndY<nOldEndY))
rX1 = Min( nNewStartX, nOldStartX );
else
rX1 = Max( nNewStartX, nOldStartX ); // Ecke weglassen
@@ -591,9 +592,9 @@ BOOL ScUpdateRect::GetXorDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, B
nContX1 = Min( nNewStartX, nOldStartX ); // links
nContX2 = Max( nNewStartX, nOldStartX ) - 1;
}
- else if ( nNewStartX == nOldStartX && nNewStartY == nOldStartY ) // rechts unten
+ else if (nNewStartX == nOldStartX && nNewStartY == nOldStartY) // rechts unten
{
- if ( (nNewEndX<nOldEndX) == (nNewEndY<nOldEndY) )
+ if ((nNewEndX<nOldEndX) == (nNewEndY<nOldEndY))
rX2 = Max( nNewEndX, nOldEndX );
else
rX2 = Min( nNewEndX, nOldEndX ); // Ecke weglassen
@@ -629,6 +630,7 @@ void ScUpdateRect::GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
rX2 = nContX2;
rY2 = nContY2;
}
+#endif