tag).
+ bool mbRowOn; /// true = Inside of
.
+ bool mbDataOn; /// true = Inside of | or | .
+ bool mbPushEmptyLine; /// true = Insert empty line before current entry.
+
+public:
+ /** Creates a new HTML table without content.
+ @descr Internally handles a current cell position. This position is invalid
+ until first calls of RowOn() and DataOn().
+ @param rParentTable Reference to the parent table that owns this table.
+ @param bPreFormText true = Table is based on preformatted text ( tag). */
+ explicit ScHTMLTable(
+ ScHTMLTable& rParentTable,
+ const ImportInfo& rInfo,
+ bool bPreFormText );
+
+ virtual ~ScHTMLTable();
+
+ /** Returns the name of the table, specified in the TABLE tag. */
+ inline const String& GetTableName() const { return maTableName; }
+ /** Returns the unique identifier of the table. */
+ inline ScHTMLTableId GetTableId() const { return maTableId.mnTableId; }
+ /** Returns the table size. */
+ inline const ScHTMLSize& GetSize() const { return maSize; }
+ /** Returns the cell spanning of the specified cell. */
+ ScHTMLSize GetSpan( const ScHTMLPos& rCellPos );
+
+ /** Searches in all nested tables for the specified table.
+ @param nTableId Unique identifier of the table. */
+ ScHTMLTable* FindNestedTable( ScHTMLTableId nTableId ) const;
+
+ /** Puts the item into the item set of the current entry. */
+ void PutItem( const SfxPoolItem& rItem );
+ /** Inserts a text portion into current entry. */
+ void PutText( const ImportInfo& rInfo );
+ /** Inserts a new line, if in preformatted text, else does nothing. */
+ void InsertPara( const ImportInfo& rInfo );
+
+ /** Inserts a line break (
tag).
+ @descr Inserts the current entry regardless if it is empty. */
+ void BreakOn();
+ /** Inserts a heading line ( and tags). */
+ void HeadingOn();
+ /** Processes a hyperlink ( tag). */
+ void AnchorOn();
+
+ /** Starts a *new* table nested in this table ( tag).
+ @return Pointer to the new table. */
+ ScHTMLTable* TableOn( const ImportInfo& rInfo );
+ /** Closes *this* table (
tag).
+ @return Pointer to the parent table. */
+ ScHTMLTable* TableOff( const ImportInfo& rInfo );
+ /** Starts a *new* table based on preformatted text ( tag).
+ @return Pointer to the new table. */
+ ScHTMLTable* PreOn( const ImportInfo& rInfo );
+ /** Closes *this* table based on preformatted text (
tag).
+ @return Pointer to the parent table. */
+ ScHTMLTable* PreOff( const ImportInfo& rInfo );
+
+ /** Starts next row ( tag).
+ @descr Cell address is invalid until first call of DataOn(). */
+ void RowOn( const ImportInfo& rInfo );
+ /** Closes the current row (
tag).
+ @descr Cell address is invalid until call of RowOn() and DataOn(). */
+ void RowOff( const ImportInfo& rInfo );
+ /** Starts the next cell ( or | tag). */
+ void DataOn( const ImportInfo& rInfo );
+ /** Closes the current cell ( or | tag).
+ @descr Cell address is invalid until next call of DataOn(). */
+ void DataOff( const ImportInfo& rInfo );
+
+ /** Starts the body of the HTML document ( tag). */
+ void BodyOn( const ImportInfo& rInfo );
+ /** Closes the body of the HTML document ( tag). */
+ void BodyOff( const ImportInfo& rInfo );
+
+ /** Returns the resulting document row/column count of the specified HTML row/column. */
+ sal_uInt16 GetDocSize( ScHTMLOrient eOrient, sal_uInt16 nCellPos ) const;
+ /** Returns the resulting document row/column count in the range [nCellBegin, nCellEnd). */
+ sal_uInt16 GetDocSize( ScHTMLOrient eOrient, sal_uInt16 nCellBegin, sal_uInt16 nCellEnd ) const;
+ /** Returns the total document row/column count in the specified direction. */
+ sal_uInt16 GetDocSize( ScHTMLOrient eOrient ) const;
+
+ /** Returns the resulting Calc position of the top left edge of the table. */
+ inline const ScHTMLPos& GetDocPos() const { return maDocBasePos; }
+ /** Calculates the resulting Calc position of the specified HTML column/row. */
+ sal_uInt16 GetDocPos( ScHTMLOrient eOrient, sal_uInt16 nCellPos = 0 ) const;
+ /** Calculates the resulting Calc position of the specified HTML cell. */
+ ScHTMLPos GetDocPos( const ScHTMLPos& rCellPos ) const;
+ /** Calculates the current Calc document area of this table. */
+ void GetDocRange( ScRange& rRange ) const;
+
+ /** Applies border formatting to the passed document. */
+ void ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos ) const;
+
+private:
+ /** Returns true, if the current cell does not contain an entry yet. */
+ bool IsEmptyCell() const;
+ /** Returns the item set from cell, row, or table, depending on current state. */
+ const SfxItemSet& GetCurrItemSet() const;
+
+ /** Returns true, if import info represents a space character. */
+ static bool IsSpaceCharInfo( const ImportInfo& rInfo );
+
+ /** Creates and returns a new empty flying entry at position (0,0). */
+ ScHTMLEntry* CreateEntry() const;
+ /** Creates a new flying entry.
+ @param rInfo Contains the initial edit engine selection for the entry. */
+ void CreateNewEntry( const ImportInfo& rInfo );
+
+ /** Inserts an empty line in front of the next entry. */
+ void InsertLeadingEmptyLine();
+
+ /** Pushes the passed entry into the list of the current cell. */
+ void ImplPushEntryToList( ScHTMLEntryList& rEntryList, ScHTMLEntryPtr& rpEntry );
+ /** Tries to insert the entry into the current cell.
+ @descr If insertion is not possible (i.e., currently no cell open), the
+ entry will be inserted into the parent table. */
+ void PushEntry( ScHTMLEntryPtr& rpEntry );
+ /** Puts the current entry into the entry list, if it is not empty.
+ @param rInfo The import info struct containing the end position of the current entry.
+ @param bLastInCell true = If cell is still empty, put this entry always. */
+ void PushEntry( const ImportInfo& rInfo, bool bLastinCell = false );
+ /** Pushes a new entry into current cell which references a nested table. */
+ void PushTableEntry( ScHTMLTableId nTableId );
+
+ /** Tries to find a table from the table container.
+ @descr Assumes that the table is located in the current container or
+ that the passed table identifier is 0.
+ @param nTableId Unique identifier of the table or 0. */
+ ScHTMLTable* GetExistingTable( ScHTMLTableId nTableId ) const;
+ /** Inserts a nested table in the current cell at the specified position.
+ @param bPreFormText true = New table is based on preformatted text ( tag). */
+ ScHTMLTable* InsertNestedTable( const ImportInfo& rInfo, bool bPreFormText );
+ /** Closes this table and inserts it into parent table.
+ @return Pointer to the parent table, or this, if no parent found. */
+ ScHTMLTable* CloseTable( const ImportInfo& rInfo );
+
+ /** Inserts a new cell in an unused position, starting from current cell position. */
+ void InsertNewCell( const ScHTMLSize& rSpanSize );
+
+ /** Set internal states for a new table row. */
+ void ImplRowOn();
+ /** Set internal states for leaving a table row. */
+ void ImplRowOff();
+ /** Set internal states for entering a new table cell. */
+ void ImplDataOn( const ScHTMLSize& rSpanSize );
+ /** Set internal states for leaving a table cell. */
+ void ImplDataOff();
+
+ /** Inserts additional formatting options from import info into the item set. */
+ void ProcessFormatOptions( SfxItemSet& rItemSet, const ImportInfo& rInfo );
+
+ /** Updates the document column/row size of the specified column or row.
+ @descr Only increases the present count, never decreases. */
+ void SetDocSize( ScHTMLOrient eOrient, sal_uInt16 nCellPos, sal_uInt16 nSize );
+ /** Calculates and sets the resulting size the cell needs in the document.
+ @descr Reduces the needed size in merged cells.
+ @param nCellPos The first column/row position of the (merged) cell.
+ @param nCellSpan The cell spanning in the specified orientation.
+ @param nRealDocSize The raw document size of all entries of the cell. */
+ void CalcNeededDocSize(
+ ScHTMLOrient eOrient, sal_uInt16 nCellPos,
+ sal_uInt16 nCellSpan, sal_uInt16 nRealDocSize );
+
+protected:
+ /** Creates a new HTML table without parent.
+ @descr This constructor is used to create the "global table". */
+ explicit ScHTMLTable(
+ SfxItemPool& rPool,
+ EditEngine& rEditEngine,
+ ScEEParseList& rEEParseList,
+ ScHTMLTableId& rnUnusedId );
+
+ /** Fills all empty cells in this and nested tables with dummy parse entries. */
+ void FillEmptyCells();
+ /** Recalculates the size of all columns/rows in the table, regarding nested tables. */
+ void RecalcDocSize();
+ /** Recalculates the position of all cell entries and nested tables.
+ @param rBasePos The origin of the table in the Calc document. */
+ void RecalcDocPos( const ScHTMLPos& rBasePos );
+};
+
+
+// ----------------------------------------------------------------------------
+
+/** The "global table" representing the entire HTML document. */
+class ScHTMLGlobalTable : public ScHTMLTable
+{
+public:
+ explicit ScHTMLGlobalTable(
+ SfxItemPool& rPool,
+ EditEngine& rEditEngine,
+ ScEEParseList& rEEParseList,
+ ScHTMLTableId& rnUnusedId );
+
+ virtual ~ScHTMLGlobalTable();
+
+ /** Recalculates sizes and resulting positions of all document entries. */
+ void Recalc();
};
+// ============================================================================
+
+/** The HTML parser for data queries. Focuses on data import, not on layout.
+ @descr Builds the table structure correctly, ignores extended formatting
+ like pictures or column widths. */
+class ScHTMLQueryParser : public ScHTMLParser
+{
+private:
+ typedef ::std::auto_ptr< ScHTMLGlobalTable > ScHTMLGlobalTablePtr;
+
+ String maTitle; /// The title of the document.
+ ScHTMLGlobalTablePtr mpGlobTable; /// Contains the entire imported document.
+ ScHTMLTable* mpCurrTable; /// Pointer to current table (performance).
+ ScHTMLTableId mnUnusedId; /// First unused table identifier.
+ bool mbTitleOn; /// true = Inside of .
+
+public:
+ explicit ScHTMLQueryParser( EditEngine* pEditEngine, ScDocument* pDoc );
+ virtual ~ScHTMLQueryParser();
+
+ virtual sal_uInt32 Read( SvStream& rStrm );
+
+ /** Returns the "global table" which contains the entire HTML document. */
+ virtual const ScHTMLTable* GetGlobalTable() const;
+
+private:
+ /** Returns the specified table (may be maGlobTable, if no real table can be found). */
+ ScHTMLTable* GetTable( ScHTMLTableId nTableId ) const;
+
+ /** Handles all possible tags in the HTML document. */
+ void ProcessToken( const ImportInfo& rInfo );
+ /** Inserts a text portion into current entry. */
+ void InsertText( const ImportInfo& rInfo );
+ /** Processes the tag. */
+ void FontOn( const ImportInfo& rInfo );
+
+ /** Processes the tag. */
+ void MetaOn( const ImportInfo& rInfo );
+ /** Opens the title of the HTML document ( tag). */
+ void TitleOn( const ImportInfo& rInfo );
+ /** Closes the title of the HTML document ( tag). */
+ void TitleOff( const ImportInfo& rInfo );
+
+ /** Opens a new table at the current position. */
+ void TableOn( const ImportInfo& rInfo );
+ /** Closes the current table. */
+ void TableOff( const ImportInfo& rInfo );
+ /** Opens a new table based on preformatted text. */
+ void PreOn( const ImportInfo& rInfo );
+ /** Closes the current preformatted text table. */
+ void PreOff( const ImportInfo& rInfo );
+
+ DECL_LINK( HTMLImportHdl, const ImportInfo* );
+};
+
+
+// ============================================================================
+
#endif
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index e56ef6d36387..fd0d5b94423b 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: imp_op.hxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: jmarmion $ $Date: 2002-12-06 16:03:48 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -359,7 +359,6 @@ protected:
virtual void SetTextCell( const UINT16 nCol, const UINT16 nRow,
String& rUnconvertedText, const UINT16 nXF );
// Achtung: rUnconvertedText wird moeglicherweise veraendert
- UINT16 CalcColWidth( const UINT16 nExcColWidth );
/** Sets a margin item into an item set.
@param rItemSet The destination item set.
diff --git a/sc/source/filter/inc/lotimpop.hxx b/sc/source/filter/inc/lotimpop.hxx
index ffe2063e5d89..be02c442d78b 100644
--- a/sc/source/filter/inc/lotimpop.hxx
+++ b/sc/source/filter/inc/lotimpop.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lotimpop.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:20:43 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index 2acff65591c2..dfe0b6b27ed6 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: namebuff.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dr $ $Date: 2001-10-31 10:52:49 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,8 @@
#include "root.hxx"
#endif
+#include "rangenam.hxx"
+
class ScDocument;
class ScTokenArray;
class NameBuffer;
@@ -218,9 +220,9 @@ public:
inline RangeNameBuffer( RootData* p );
// Name, Definition
void Store( ByteString&, const ScTokenArray*,
- UINT16 nAltSheet = 0, const BOOL bPrintarea = FALSE );
+ UINT16 nAltSheet = 0, const RangeType eNameType = RT_ABSAREA );
void Store( String&, const ScTokenArray*,
- UINT16 nAltSheet = 0, const BOOL bPrintarea = FALSE );
+ UINT16 nAltSheet = 0, const RangeType eNameType = RT_ABSAREA );
inline UINT16 operator[]( UINT16 nExcInd ) const;
inline UINT16 GetPos( void ) const;
};
diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index 38b2ecb6a6ef..d0535139d696 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: root.hxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:07 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,9 +102,7 @@ class XclExpUserBViewList;
class XclExpCellMerging;
class ExcNameList;
-class UsedAttrList;
class XclObjList;
-class XclNoteList;
class XclEscher;
class XclPivotCacheList;
class SfxStyleSheet;
@@ -119,7 +117,6 @@ class XclExpRoot;
struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt!
{
SvStorage* pRootStorage; // THE storage
- double fColScale; // Skalierungs-Faktoren fuer
double fRowScale; // Spaltenbreiten / Zeilenhoehen
ScDocument* pDoc;
ScRangeName* pScRangeName;
@@ -144,9 +141,6 @@ struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt!
SvStorage* pPivotCacheStorage;
XclImpPivotCacheList* pImpPivotCacheList; // pivot caches for import
- SvStorageRef xCtrlStorage; // SvxMSConvertOCXControls compatibel storage
-// SvStorage* pCtrlStorage; // SvxMSConvertOCXControls compatibel storage
-
UINT32 nCondRangeCnt;
UINT16 nLastCond;
String GetCondFormStyleName( const UINT16 nCondCnt ); // -> exctools.cxx
@@ -158,13 +152,11 @@ struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt!
ExcNameList* pNameList;
ScRangeName* pScNameList; // stores range names and DB ranges
- UsedAttrList* pXFRecs;
ExcExternDup* pExtSheetCntAndRecs;
UINT16 nColMax;
UINT16 nRowMax;
// Biff8
XclObjList* pObjRecs;
- XclNoteList* pNoteRecs;
String sAddNoteText; // text to append at current note (multiple hyperlinks)
XclEscher* pEscher;
diff --git a/sc/source/filter/inc/scflt.hxx b/sc/source/filter/inc/scflt.hxx
index 74dff29b267d..898653e46795 100644
--- a/sc/source/filter/inc/scflt.hxx
+++ b/sc/source/filter/inc/scflt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scflt.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: er $ $Date: 2002-12-06 17:44:47 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -732,7 +732,7 @@ public:
};
-class FilterProgressBar;
+class ScfStreamProgressBar;
// Import-Klasse
class Sc10Import
@@ -752,7 +752,7 @@ class Sc10Import
INT16 TabCount;
USHORT nShowTab;
ScViewOptions aSc30ViewOpt;
- FilterProgressBar* pPrgrsBar;
+ ScfStreamProgressBar* pPrgrsBar;
public:
Sc10Import( SvStream& rStr, ScDocument* pDocument );
diff --git a/sc/source/filter/inc/xcl97dum.hxx b/sc/source/filter/inc/xcl97dum.hxx
index 308e98d892b5..c1a09297d36d 100644
--- a/sc/source/filter/inc/xcl97dum.hxx
+++ b/sc/source/filter/inc/xcl97dum.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97dum.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:07 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,28 +112,6 @@ public:
};
-class ExcDummy8_XF : public ExcDummyRec
-{
-private:
- static const BYTE pMyData[];
- static const ULONG nMyLen;
-public:
- virtual ULONG GetLen() const;
- virtual const BYTE* GetData() const;
-};
-
-
-class ExcDummy8_Style : public ExcDummyRec
-{
-private:
- static const BYTE pMyData[];
- static const ULONG nMyLen;
-public:
- virtual ULONG GetLen() const;
- virtual const BYTE* GetData() const;
-};
-
-
class ExcDummy8_UsesElfs : public ExcDummyRec
{
private:
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index 952e09c6c626..9747016ad277 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97esc.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dr $ $Date: 2002-12-12 11:50:27 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,10 @@
#include
#endif
+#ifndef SC_XLOCX_HXX
+#include "xlocx.hxx"
+#endif
+
namespace utl { class TempFile; }
// --- class XclEscherEx ---------------------------------------------
@@ -89,6 +93,9 @@ class XclEscherEx : public EscherEx
private:
List aOffsetMap;
Stack aStack;
+#if EXC_INCL_EXP_OCX
+ XclExpOcxConverter aOcxConverter; /// Export of form controls.
+#endif
RootData& rRootData;
utl::TempFile* pPicTempFile;
SvStream* pPicStrm;
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 77942f548f63..959900a3854f 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97rec.hxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:07 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -228,7 +228,11 @@ protected:
UINT16 nGrbit;
BOOL bFirstOnSheet;
- XclObj( ObjType eObjType, RootData& rRoot );
+ bool mbOwnEscher; /// true = Escher part created on the fly.
+
+ /** @param bOwnEscher If set to true, this object will create its escher data.
+ See SetOwnEscher() for details. */
+ explicit XclObj( ObjType eObjType, RootData& rRoot, bool bOwnEscher = false );
// overwritten for writing MSODRAWING record
virtual void SaveCont( XclExpStream& rStrm );
@@ -252,6 +256,17 @@ public:
void SetEscherShapeType( UINT16 nType );
inline void SetEscherShapeTypeGroup() { eObjType = otGroup; }
+ /** If set to true, this object has created its own escher data. This causes the
+ function EscherEx::EndShape() to not post process this object. This is used
+ i.e. for form controls. They are not handled in the svx base code, so the
+ XclExpObjControl c'tor creates the escher data itself. The svx base code does
+ not receive the correct shape ID after the EscherEx::StartShape() call, which
+ would result in deleting the object in EscherEx::EndShape(). */
+ inline void SetOwnEscher( bool bOwnEscher = true ) { mbOwnEscher = bOwnEscher; }
+ /** Returns true, if the object has created the escher data itself.
+ See SetOwnEscher() for details. */
+ inline bool IsOwnEscher() const { return mbOwnEscher; }
+
//! actually writes ESCHER_ClientTextbox
void SetText( RootData& rRoot, const SdrTextObj& rObj );
@@ -282,7 +297,7 @@ private:
public:
XclObjComment( RootData& rRoot,
- const ScAddress& rPos, const String& rStr );
+ const ScAddress& rPos, const String& rStr, bool bVisible );
virtual ~XclObjComment();
virtual void Save( XclExpStream& rStrm );
@@ -356,6 +371,34 @@ public:
};
+// ----------------------------------------------------------------------------
+
+#if EXC_INCL_EXP_OCX
+
+/** Represents an OBJ record for a form control. */
+class XclExpObjControl : public XclObj
+{
+private:
+ String maClassName; /// Class name of the control.
+ sal_uInt32 mnStrmStart; /// Start position in 'Ctls' stream.
+ sal_uInt32 mnStrmSize; /// Size in 'Ctls' stream.
+
+public:
+ XclExpObjControl(
+ const XclRoot& rRoot,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >& rxShape,
+ const String& rClassName,
+ sal_uInt32 nStrmStart, sal_uInt32 nStrmSize );
+
+ virtual sal_uInt32 GetLen() const;
+
+private:
+ virtual void SaveCont( XclExpStream& rStrm );
+};
+
+#endif
+
// --- class XclObjAny -----------------------------------------------
class XclObjAny : public XclObj
@@ -372,48 +415,45 @@ public:
};
-// --- class XclNoteList ---------------------------------------------
+// ============================================================================
-class XclNote;
-
-class XclNoteList : public List, public ExcEmptyRec
+/** Represents a NOTE record containing the author and the note object ID.
+ @descr Creates the note Escher object internally. */
+class XclExpNote : public XclExpRecord
{
private:
-public:
- XclNoteList();
- virtual ~XclNoteList();
-
- XclNote* First() { return (XclNote*) List::First(); }
- XclNote* Next() { return (XclNote*) List::Next(); }
-
- void Add( XclNote* );
-
+ XclExpString maAuthor; /// Name of the author.
+ ScAddress maPos; /// Cell address of the note.
+ sal_uInt16 mnObjId; /// Escher object ID.
+ bool mbVisible; /// true = permanently visible.
+
+public:
+ /** Constructs a NOTE record from the passed note object and/or the text.
+ @descr The additional text will be separated from the note text with an empty line.
+ Creates the Escher object containing the drawing information and the note text.
+ @param rPos The Calc cell address of the note.
+ @param pScNote The Calc note object.
+ @param rAddText Additional text appended to the note text. */
+ explicit XclExpNote(
+ const XclExpRoot& rRoot,
+ const ScAddress& rPos,
+ const ScPostIt* pScNote,
+ const String& rAddText );
+
+ /** Writes the NOTE record, if the respective Escher object is present. */
virtual void Save( XclExpStream& rStrm );
-};
-
-// --- class XclNote -------------------------------------------------
-
-class XclNote : public ExcRecord
-{
private:
- XclExpUniString aAuthor;
- ScAddress aPos;
- UINT16 nGrbit;
- UINT16 nObjId;
+ /** Writes the body of the NOTE record. */
+ virtual void WriteBody( XclExpStream& rStrm );
+};
- virtual void SaveCont( XclExpStream& rStrm );
-public:
- XclNote( RootData& rD, const ScAddress& rPos,
- const String& rNoteText, const String& rNoteAuthor );
- virtual ~XclNote();
+/** A list of NOTE record objects. */
+typedef XclExpRecordList< XclExpNote > XclExpNoteList;
- virtual void Save( XclExpStream& rStrm );
- virtual UINT16 GetNum() const;
- virtual ULONG GetLen() const;
-};
+// ============================================================================
// --- class ExcBof8_Base --------------------------------------------
@@ -490,34 +530,6 @@ public:
};
-// --- class ExcXf8 --------------------------------------------------
-
-class ExcXf8 : public ExcXf
-{
-private:
- XclTextDirection eTextDir;
- UINT16 nTrot;
- UINT16 nCIndent;
-
- UINT16 nGrbitDiag;
- UINT32 nIcvDiagSer;
- UINT16 nDgDiag;
-
- BOOL bFShrinkToFit;
- BOOL bFMergeCell;
-
- virtual void SaveCont( XclExpStream& rStrm );
-
-public:
- ExcXf8( const XclExpRoot& rRoot, UINT16 nFont, UINT16 nForm,
- const ScPatternAttr* pPattAttr,
- BOOL& rbLineBreak, BOOL bStyle = FALSE );
-
- virtual UINT16 GetNum() const;
- virtual ULONG GetLen() const;
-};
-
-
// --- class ExcBundlesheet8 -----------------------------------------
class ExcBundlesheet8 : public ExcBundlesheetBase
@@ -609,7 +621,7 @@ class ScRangeList;
struct RootData;
class XclCf;
-class XclCondFormat : public ExcEmptyRec, protected List
+class XclCondFormat : public ExcEmptyRec, protected ScfDelList< XclCf >
{
// writes multiple cf _and_ condfmt records!
private:
@@ -618,9 +630,6 @@ private:
UINT16 nTabNum;
ULONG nComplLen;
- inline XclCf* _First() { return (XclCf*) List::First(); }
- inline XclCf* _Next() { return (XclCf*) List::Next(); }
-
void WriteCondfmt( XclExpStream& rStrm );
public:
@@ -661,17 +670,10 @@ private:
UINT32 nIcvTextSer;
BOOL bHasLine;
- UINT8 nLineData1;
- UINT8 nLineData2;
- UINT32 nIcvTopSer;
- UINT32 nIcvBotSer;
- UINT32 nIcvLftSer;
- UINT32 nIcvRigSer;
+ XclExpXFBorder maBorder;
BOOL bHasPattern;
- UINT16 nPatt;
- UINT32 nIcvForeSer;
- UINT32 nIcvBackSer;
+ XclExpXFArea maArea;
virtual void SaveCont( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx
index d55b51921696..f2f3f9804407 100644
--- a/sc/source/filter/inc/xecontent.hxx
+++ b/sc/source/filter/inc/xecontent.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xecontent.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:10 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index 65589f48c50b..1db07acad757 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xehelper.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -316,8 +316,10 @@ class EditEngine;
&N page count
&D current date
&T current time
- &F file name without path (converted to full file name)
&A table name
+ &F file name without path
+ &Z file path without file name
+ &Z&F file path and name
&U underlining on/off
&E double underlining on/off
&S strikeout characters on/off
@@ -327,7 +329,6 @@ class EditEngine;
Known but unsupported control sequences:
&X superscript on/off
&Y subscript on/off
- &Z file path without file name
&G picture
*/
class XclExpHFConverter : protected XclExpRoot, ScfNoCopy
diff --git a/sc/source/filter/inc/xelink.hxx b/sc/source/filter/inc/xelink.hxx
index c6e2b1936211..f3ef7eddd71d 100644
--- a/sc/source/filter/inc/xelink.hxx
+++ b/sc/source/filter/inc/xelink.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xelink.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx
index f57150df8f8c..55526628b5b9 100644
--- a/sc/source/filter/inc/xerecord.hxx
+++ b/sc/source/filter/inc/xerecord.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xerecord.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,6 +86,9 @@ public:
/** Overwrite this method to do any operation while saving the record list. */
virtual void Save( XclExpStream& rStrm );
+
+ /** Calls Save(XclExpStream&) nCount times. */
+ void SaveRepeated( XclExpStream& rStrm, sal_uInt32 nCount );
};
@@ -106,7 +109,7 @@ private:
public:
/** @param nRecId The record ID of this record. May be set later with SetRecId().
@param nRecSize The predicted record size. May be set later with SetRecSize(). */
- XclExpRecord(
+ explicit XclExpRecord(
sal_uInt16 nRecId = EXC_ID_UNKNOWN,
sal_uInt32 nRecSize = 0 );
@@ -114,13 +117,15 @@ public:
/** Returns the current record ID. */
inline sal_uInt16 GetRecId() const { return mnRecId; }
- /** Sets a new record ID. */
- inline void SetRecId( sal_uInt16 nRecId ) { mnRecId = nRecId; }
-
/** Returns the current record size prediction. */
inline sal_uInt32 GetRecSize() const { return mnRecSize; }
+
+ /** Sets a new record ID. */
+ inline void SetRecId( sal_uInt16 nRecId ) { mnRecId = nRecId; }
/** Sets a new record size prediction. */
inline void SetRecSize( sal_uInt32 nRecSize ) { mnRecSize = nRecSize; }
+ /** Sets record ID and size with one call. */
+ void SetRecHeader( sal_uInt16 nRecId, sal_uInt32 nRecSize );
/** Writes the record header and calls WriteBody(). */
virtual void Save( XclExpStream& rStrm );
@@ -139,10 +144,7 @@ class XclExpEmptyRecord : public XclExpRecord
{
public:
/** @param nRecId The record ID of this record. */
- inline XclExpEmptyRecord( sal_uInt16 nRecId );
-
-private:
- void SetRecSize( sal_uInt32 );
+ inline explicit XclExpEmptyRecord( sal_uInt16 nRecId );
};
inline XclExpEmptyRecord::XclExpEmptyRecord( sal_uInt16 nRecId ) :
@@ -165,7 +167,7 @@ public:
/** @param nRecId The record ID of this record.
@param rValue The value for the record body.
@param nSize Record size. Uses sizeof( Type ), if this parameter is omitted. */
- inline XclExpValueRecord(
+ inline explicit XclExpValueRecord(
sal_uInt16 nRecId,
const Type& rValue,
sal_uInt32 nSize = sizeof( Type ) );
@@ -218,7 +220,7 @@ private:
public:
/** @param nRecId The record ID of this record.
@param nValue The value for the record body. */
- inline XclExpBoolRecord( sal_uInt16 nRecId, bool bValue ) :
+ inline explicit XclExpBoolRecord( sal_uInt16 nRecId, bool bValue ) :
XclExpRecord( nRecId, 2 ), mbValue( bValue ) {}
/** Returns the Boolean value of the record. */
@@ -232,6 +234,30 @@ private:
};
+// ----------------------------------------------------------------------------
+
+/** Record which exports a memory data array. */
+class XclExpDummyRecord : public XclExpRecord
+{
+private:
+ const void* mpData; /// The record data.
+
+public:
+ /** @param nRecId The record ID of this record.
+ @param nRecData Pointer to the data array representing the record body.
+ @param nRecSize Size of the data array. */
+ explicit XclExpDummyRecord(
+ sal_uInt16 nRecId, const void* pRecData, sal_uInt32 nRecSize );
+
+ /** Sets a data array. */
+ void SetData( const void* pRecData, sal_uInt32 nRecSize );
+
+private:
+ /** Writes the body of the record. */
+ virtual void WriteBody( XclExpStream& rStrm );
+};
+
+
// ----------------------------------------------------------------------------
/** A record that stores a reference to an existing record object.
@@ -244,7 +270,7 @@ protected:
XclExpRecordBase& mrRec; /// Reference to the record.
public:
- inline XclExpRefRecord( XclExpRecordBase& rRec ) : mrRec( rRec ) {}
+ inline explicit XclExpRefRecord( XclExpRecordBase& rRec ) : mrRec( rRec ) {}
/** Writes the entire record. */
virtual void Save( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx
index 30c6940393d8..dbf69624dc1e 100644
--- a/sc/source/filter/inc/xeroot.hxx
+++ b/sc/source/filter/inc/xeroot.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xeroot.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,6 +75,7 @@ class XclExpSst;
class XclExpPalette;
class XclExpFontBuffer;
class XclExpNumFmtBuffer;
+class XclExpXFBuffer;
class XclExpTabIdBuffer;
class XclExpLinkManager;
@@ -85,6 +86,7 @@ struct XclExpRootData : public XclRootData
typedef ::std::auto_ptr< XclExpPalette > XclExpPalettePtr;
typedef ::std::auto_ptr< XclExpFontBuffer > XclExpFontBufferPtr;
typedef ::std::auto_ptr< XclExpNumFmtBuffer > XclExpNumFmtBufferPtr;
+ typedef ::std::auto_ptr< XclExpXFBuffer > XclExpXFBufferPtr;
typedef ::std::auto_ptr< XclExpTabIdBuffer > XclExpTabIdBufferPtr;
typedef ::std::auto_ptr< XclExpLinkManager > XclExpLinkManagerPtr;
@@ -93,6 +95,7 @@ struct XclExpRootData : public XclRootData
XclExpPalettePtr mpPalette; /// The color buffer.
XclExpFontBufferPtr mpFontBuffer; /// All fonts in the file.
XclExpNumFmtBufferPtr mpNumFmtBuffer; /// All number formats in the file.
+ XclExpXFBufferPtr mpXFBuffer; /// All XF records in the file.
XclExpTabIdBufferPtr mpTabIdBuffer; /// Calc->Excel sheet index conversion.
XclExpLinkManagerPtr mpLinkManager; /// Manager for internal/external links.
@@ -121,6 +124,8 @@ public:
XclExpRoot& operator=( const XclExpRoot& rRoot );
+ /** Returns this root instance - for code readability in derived classes. */
+ inline const XclExpRoot& GetRoot() const { return *this; }
/** Returns true, if URLs should be stored relative to the document location. */
inline bool IsRelUrl() const { return mrExpData.mbRelUrl; }
@@ -133,6 +138,8 @@ public:
XclExpFontBuffer& GetFontBuffer() const;
/** Returns the number format buffer. */
XclExpNumFmtBuffer& GetNumFmtBuffer() const;
+ /** Returns the cell formatting attributes buffer. */
+ XclExpXFBuffer& GetXFBuffer() const;
/** Returns the buffer for Calc->Excel sheet index conversion. */
XclExpTabIdBuffer& GetTabIdBuffer() const;
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index f876dd9e8481..14de4e71e5e8 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xestream.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index e9e56e37e0c5..9eb2f0330549 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xestyle.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:37:56 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,9 @@
#ifndef _SVX_SVXENUM_HXX
#include
#endif
+#ifndef _ZFORLIST_HXX
+#include
+#endif
#ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX
#include
#endif
@@ -112,8 +115,14 @@ enum XclColorType
// ----------------------------------------------------------------------------
/** Stores all used colors in the document.
- @descr Supports color reduction to the maximum count of the current BIFF version. */
-class XclExpPalette : public XclExpRecord, public XclDefaultPalette
+ @descr Supports color reduction to the maximum count of the current BIFF version.
+ An instance of this class collects all colors in the conversion phase of the export,
+ using the InsertColor() function. It returns a unique identidier for each passed color.
+ After the entire document is converted, the palette will be reduced to the number of
+ colors supported by the current BIFF version, using the function ReduceColors().
+ Then, in the streaming phase, the functions GetColorIndex() and GetMixedColors()
+ return the real Excel palette index for all color identifiers. */
+class XclExpPalette : public XclExpRecord, public XclDefaultPalette, protected XclExpRoot
{
private:
/** Represents an entry in a color list.
@@ -126,16 +135,16 @@ private:
private:
Color maColor; /// The color value of this palette entry.
- sal_uInt32 mnCID; /// Unique color ID (CID) for color reduction.
+ sal_uInt32 mnColorId; /// Unique color ID for color reduction.
sal_uInt32 mnWeight; /// Weighting for color reduction.
public:
- explicit XclListColor( const Color& rColor, sal_uInt32 nCID );
+ explicit XclListColor( const Color& rColor, sal_uInt32 nColorId );
/** Returns the RGB color value of the color. */
inline const Color& GetColor() const { return maColor; }
/** Returns the unique ID of the color. */
- inline sal_uInt32 GetCID() const { return mnCID; }
+ inline sal_uInt32 GetColorId() const { return mnColorId; }
/** Returns the current weighting of the color. */
inline sal_uInt32 GetWeighting() const { return mnWeight; }
/** Returns true, if this color value is greater than rColor (simple arithmetic comparison). */
@@ -151,11 +160,11 @@ private:
void Merge( const XclListColor& rColor );
};
- /** Data for each inserted original color, represented by a CID (color ID). */
- struct XclCIDData
+ /** Data for each inserted original color, represented by a color ID. */
+ struct XclColorIdData
{
- Color maColor; /// The original inserted color.
- sal_uInt32 mnIndex; /// Maps current CID to color list or export color vector.
+ Color maColor; /// The original inserted color.
+ sal_uInt32 mnIndex; /// Maps current color ID to color list or export color vector.
/** Sets the contents of this struct. */
inline void Set( const Color& rColor, sal_uInt32 nIndex ) { maColor = rColor; mnIndex = nIndex; }
};
@@ -163,27 +172,27 @@ private:
/** A color that will be written to the Excel file. */
struct XclPaletteColor
{
- Color maColor; /// Resulting color to export.
- bool mbDefault; /// true = Entry is a default color.
+ Color maColor; /// Resulting color to export.
+ bool mbDefault; /// true = Entry is a default color.
/** Sets a new color.
@param bDefault true = Color is a color from default palette. */
inline void SetColor( const Color& rColor, bool bDefault = false ) { maColor = rColor; mbDefault = bDefault; }
};
typedef ScfDelList< XclListColor > XclListColorList;
- typedef ::std::vector< XclCIDData > XclCIDDataVec;
+ typedef ::std::vector< XclColorIdData > XclColorIdDataVec;
typedef ::std::vector< XclPaletteColor > XclPaletteColorVec;
- XclListColorList maColorList; /// Working color list.
- XclCIDDataVec maCIDDataVec; /// Data of all CIDs.
- XclPaletteColorVec maPalette; /// Contains resulting colors to export.
- sal_uInt32 mnLastIx; /// Last insertion index for search opt.
+ XclListColorList maColorList; /// Working color list.
+ XclColorIdDataVec maColorIdDataVec; /// Data of all CIDs.
+ XclPaletteColorVec maPalette; /// Contains resulting colors to export.
+ sal_uInt32 mnLastIx; /// Last insertion index for search opt.
public:
explicit XclExpPalette( const XclExpRoot& rRoot );
- /** Activates the default colors for the passed BIFF version. */
- void SetBiff( XclBiff eBiff );
+ /** Activates the default colors for the current BIFF version. */
+ void OnChangeBiff();
/** Inserts the color into the list and updates weighting.
@param nAutoDefault The Excel palette index for automatic color.
@@ -196,19 +205,19 @@ public:
/** Reduces the color list to the maximum count of the current BIFF version. */
void ReduceColors();
- /** Returns the Excel palette index of the color with passed color ID (CID). */
- sal_uInt16 GetColorIndex( sal_uInt32 nCID ) const;
+ /** Returns the Excel palette index of the color with passed color ID. */
+ sal_uInt16 GetColorIndex( sal_uInt32 nColorId ) const;
/** Returns the Excel palette index of the passed color (searches for nearest color).
@param nAutoDefault The Excel palette index for automatic color. */
sal_uInt16 GetColorIndex( const Color& rColor, sal_uInt16 nAutoDefault = 0 ) const;
- /** Returns a foreground and background color for the two passed CIDs.
+ /** Returns a foreground and background color for the two passed color IDs.
@descr If rnXclPattern contains a solid pattern, this function tries to find
- the two best fitting colors and a mix pattern (25%, 50% or 75%) for nCIDForegr.
+ the two best fitting colors and a mix pattern (25%, 50% or 75%) for nForeColorId.
This will result in a better approximation to the passed foreground color. */
void GetMixedColors(
- sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx, sal_uInt16& rnXclPattern,
- sal_uInt32 nCIDForegr, sal_uInt32 nCIDBackgr ) const;
+ sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx, sal_uInt8& rnXclPattern,
+ sal_uInt32 nForeColorId, sal_uInt32 nBackColorId ) const;
/** Returns the RGB color data for a (non-zero-based) Excel palette entry.
@param nDefault Is returned, if nothing else could be found. */
@@ -218,8 +227,8 @@ public:
inline Color GetColor( sal_uInt16 nXclIndex, ColorData nDefault = COL_AUTO ) const;
private:
- /** Returns the original inserted color represented by nCID. */
- const Color& GetOriginalColor( sal_uInt32 nCID ) const;
+ /** Returns the original inserted color represented by the color ID nColorId. */
+ const Color& GetOriginalColor( sal_uInt32 nColorId ) const;
/** Returns the ordered insertion index for rColor in rnIndex.
@param rbIsEqual Returns true, if the color already exists. */
@@ -271,7 +280,7 @@ class XclExpFont : public XclExpRecord, protected XclExpRoot
{
private:
XclFontData maData; /// All font attributes.
- sal_uInt32 mnCID; /// Unique color ID for text color.
+ sal_uInt32 mnColorId; /// Unique color ID for text color.
sal_uInt32 mnHash; /// Hash value for fast comparison.
bool mbHasColor; /// false = Font does not use a color (i.e. chart).
@@ -285,7 +294,7 @@ public:
inline void SetFamily( FontFamily eFamily ) { maData.mnFamily = GetXclFamily( eFamily ); }
inline void SetCharSet( rtl_TextEncoding eCharSet ) { maData.mnCharSet = GetXclCharSet( eCharSet ); }
void SetColor( const Color& rColor );
- void SetCID( sal_uInt32 nCID );
+ void SetColorId( sal_uInt32 nColorId );
void SetHeight( sal_Int32 nTwips );
inline void SetWeight( FontWeight eWeight ) { maData.mnWeight = GetXclWeight( eWeight ); }
inline void SetUnderline( FontUnderline eUnderl ) { maData.meUnderline = GetXclUnderline( eUnderl ); }
@@ -308,7 +317,7 @@ public:
/** Returns true, if this font contains a specific color (if SetColor was called before). */
inline bool HasColor() const { return mbHasColor; }
/** Returns the unique color ID of the font color from palette. */
- inline sal_uInt32 GetCID() const { return mnCID; }
+ inline sal_uInt32 GetColorId() const { return mnColorId; }
/** Converts a font family to Excel font family. */
static sal_uInt8 GetXclFamily( FontFamily eFamily );
@@ -335,14 +344,17 @@ class ScPatternAttr;
class XclExpFontBuffer : public XclExpRecordBase, protected XclExpRoot
{
private:
- XclExpRecordList< XclExpFont > maFontList; /// List of all FONT records.
- sal_uInt32 mnMaxCount; /// Maximum possible count of fonts.
+ typedef XclExpRecordList< XclExpFont > XclExpFontList;
+
+ XclExpFontList maFontList; /// List of all FONT records.
+ XclFontData maAppFont; /// Application font (for column width).
+ sal_uInt32 mnXclMaxCount; /// Maximum number of fonts.
public:
explicit XclExpFontBuffer( const XclExpRoot& rRoot );
- /** Activates the default colors for the passed BIFF version. */
- void SetBiff( XclBiff eBiff );
+ /** Finds the maximum number of fonts for the current BIFF version. */
+ void OnChangeBiff();
/** Returns the specified font from font list. */
inline const XclExpFont* GetFont( sal_uInt32 nIndex ) const
@@ -368,7 +380,7 @@ private:
/** Initializes the default fonts for the current BIFF version. */
void InitDefaultFonts();
/** Converts a list index into Excel font index. */
- sal_uInt16 GetXclIndex( sal_uInt32 nIndex );
+ sal_uInt16 GetXclIndex( sal_uInt32 nIndex ) const;
/** Tries to find the passed font and returns the current list index. */
sal_uInt32 Find( const XclExpFont& rFont );
};
@@ -402,6 +414,7 @@ private:
SvNumberFormatterPtr mpFormatter; /// Special number formatter for conversion.
NfKeywordTablePtr mpKeywordTable; /// Replacement table.
XclExpNumFmtVec maFormatMap; /// Maps core formats to Excel indexes.
+ sal_uInt32 mnStdFmt; /// Key for standard number format.
sal_uInt16 mnXclOffset; /// Offset to first user defined format.
public:
@@ -409,13 +422,16 @@ public:
virtual ~XclExpNumFmtBuffer();
- /** Sets internal data for the passed BIFF version. */
- void SetBiff( XclBiff eBiff );
+ /** Sets internal data for the current BIFF version. */
+ void OnChangeBiff();
+
+ /** Returns the core index of the current standard number format. */
+ inline sal_uInt32 GetStandardFormat() const { return mnStdFmt; }
/** Inserts a number format into the format buffer.
@param nFormatIx The core index of the number format.
@return The resulting Excel format index. */
- sal_uInt16 Insert( sal_uInt32 nFormatIx );
+ sal_uInt16 Insert( sal_uInt32 nScFormatIx );
/** Writes all FORMAT records contained in this buffer. */
virtual void Save( XclExpStream& rStrm );
@@ -432,6 +448,206 @@ private:
// XF, STYLE record - Cell formatting =========================================
+/** Contains color and line style for each cell border line. */
+struct XclExpXFBorder
+{
+ sal_uInt32 mnLeftColorId; /// Color ID for left line.
+ sal_uInt32 mnRightColorId; /// Color ID for right line.
+ sal_uInt32 mnTopColorId; /// Color ID for top line.
+ sal_uInt32 mnBottomColorId; /// Color ID for bottom line.
+ sal_uInt8 mnLeftLine; /// Style of left line.
+ sal_uInt8 mnRightLine; /// Style of right line.
+ sal_uInt8 mnTopLine; /// Style of top line.
+ sal_uInt8 mnBottomLine; /// Style of bottom line.
+
+ explicit XclExpXFBorder();
+};
+
+
+// ----------------------------------------------------------------------------
+
+/** Contains background colors and pattern. */
+struct XclExpXFArea
+{
+ sal_uInt32 mnForeColorId; /// Foreground color ID.
+ sal_uInt32 mnBackColorId; /// Background color ID.
+ sal_uInt8 mnPattern; /// Fill pattern.
+
+ explicit XclExpXFArea();
+};
+
+
+// ----------------------------------------------------------------------------
+
+class SfxStyleSheetBase;
+class SvxBoxItem;
+class SvxBorderLine;
+
+/** Represents an XF record which contains all formatting data of a cell or cell style. */
+class XclExpXF : public XclExpRecord
+{
+private:
+ typedef ::std::auto_ptr< ScPatternAttr > ScPatternAttrPtr;
+
+ ScPatternAttrPtr mpOwnPattern; /// An own item set (used for cell styles).
+ const ScPatternAttr* mpPattern; /// Pointer to Calc item set (we do not own it).
+
+ XclExpXFBorder maBorder; /// Border line style.
+ XclExpXFArea maArea; /// Background area style.
+ XclHorAlign meHorAlign; /// Horizontal alignment.
+ XclVerAlign meVerAlign; /// Vertical alignment.
+ XclTextOrient meOrient; /// Text orientation.
+ XclTextDirection meTextDir; /// CTL text direction.
+
+ sal_uInt16 mnParent; /// Index to parent style XF.
+ sal_uInt16 mnFont; /// Excel font index.
+ sal_uInt16 mnNumFmt; /// Excel number format index.
+ sal_uInt8 mnIndent; /// Text indent.
+ sal_uInt8 mnRotation; /// Rotation angle.
+
+ bool mbCellXF; /// true = cell XF, false = style XF.
+ bool mbLocked; /// true = cell is locked.
+ bool mbHidden; /// true = formulas are hidden.
+ bool mbWrapped; /// true = wrap text on cell border.
+ bool mbProtUsed; /// true = locked/hidden flags used.
+ bool mbFontUsed; /// true = font index used.
+ bool mbFmtUsed; /// true = number format used.
+ bool mbAlignUsed; /// true = alignment used.
+ bool mbBorderUsed; /// true = border data used.
+ bool mbAreaUsed; /// true = area data used.
+
+public:
+ /** Constructs a cell XF record from the passed Calc item set.
+ @param nForcedNumFmt If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite
+ the number format of the passed item set.
+ @param bForcedWrap true = set text wrap flag unconditionally. */
+ explicit XclExpXF(
+ const XclExpRoot& rRoot,
+ const ScPatternAttr* pPattern,
+ sal_uInt32 nForcedNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND,
+ bool bForceWrapped = false );
+ /** Constructs a style XF record from the passed cell style sheet. */
+ explicit XclExpXF( const XclExpRoot& rRoot, SfxStyleSheetBase& rStyleSheet );
+
+ /** Returns true, if the passed cell formatting is represented by this XF record.
+ @descr Searches for cell XFs only. */
+ bool Equals(
+ const ScPatternAttr* pPattern,
+ sal_uInt32 nForcedNumFmt,
+ bool bForceWrapped ) const;
+
+ /** Sets the border line styles from the item set into the passed struct. */
+ static void GetBorder(
+ XclExpXFBorder& rBorder,
+ XclExpPalette& rPalette,
+ const ScPatternAttr& rPattern );
+
+ /** Sets the area styles from the brush item into the passed struct. */
+ static void GetArea(
+ XclExpXFArea& rArea,
+ XclExpPalette& rPalette,
+ const ScPatternAttr& rPattern );
+
+private:
+ /** Fills all members from the passed item set. */
+ void Init(
+ const XclExpRoot& rRoot,
+ const ScPatternAttr* pPattern,
+ sal_uInt32 nForcedNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND,
+ bool bForceWrapped = false );
+
+ /** Returns the bits specifying the used attributes.
+ @descr In cell XFs a set bit means a used attribute, in style XF a cleared
+ bit means a used attribute. This method regards the cell/style state.
+ @return The mask based on bit 0 (not yet bit-shifted as needed for export). */
+ sal_uInt8 GetUsedAttribMask() const;
+
+ void WriteBody5( XclExpStream& rStrm );
+ void WriteBody8( XclExpStream& rStrm );
+
+ /** Writes the contents of the XF record. */
+ virtual void WriteBody( XclExpStream& rStrm );
+
+ /** Reads the passed border line struct and converts to Excel line style and color. */
+ static void GetBorderLine(
+ sal_uInt8& rnXclLine, sal_uInt32& rnColorId,
+ XclExpPalette& rPalette, const SvxBorderLine* pLine );
+};
+
+
+// ----------------------------------------------------------------------------
+
+/** Represents a STYLE record containing the name of a user-defined cell style. */
+class XclExpStyle : public XclExpRecord
+{
+private:
+ String maName; /// Name of the cell style.
+ sal_uInt16 mnXFIndex; /// Index to XF record with style formatting.
+
+public:
+ explicit XclExpStyle( const String& rName, sal_uInt16 nXFIndex );
+
+private:
+ /** Writes the contents of the STYLE record. */
+ virtual void WriteBody( XclExpStream& rStrm );
+};
+
+
+// ----------------------------------------------------------------------------
+
+/** Stores all XF records (cell formats) in the document. */
+class XclExpXFBuffer : public XclExpRecordBase, protected XclExpRoot
+{
+private:
+ typedef XclExpRecordList< XclExpXF > XclExpXFList;
+ typedef XclExpRecordList< XclExpStyle > XclExpStyleList;
+
+ XclExpXFList maXFList; /// List of all XF records.
+ XclExpStyleList maStyleList; /// List of all STYLE records.
+ sal_uInt32 mnXclMaxCount; /// Maximum number of XF records.
+ sal_uInt16 mnXclOffset; /// Offset to first user defined XF.
+
+public:
+ explicit XclExpXFBuffer( const XclExpRoot& rRoot );
+
+ /** Inserts all user-defined styles into the XF record list. */
+ void InsertUserStyles();
+
+ /** Finds or creates a cell XF record for the passed item set.
+ @param bForceWrapped true = cell contains hard newlines.
+ In this case the text wrap flag must be set in the XF record.
+ @return The resulting Excel XF record index. */
+ sal_uInt16 Insert( const ScPatternAttr* pPattern, bool bForceWrapped = false );
+ /** Finds or creates a cell XF record for the passed item set, with custom number format.
+ @param nForcedNumFmt The number format to be exported, i.e. formula result type.
+ This format will always overwrite the cell's number format.
+ @return The resulting Excel XF record index. */
+ sal_uInt16 Insert( const ScPatternAttr* pPattern, sal_uInt32 nForcedNumFmt );
+ /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
+ @return The resulting Excel XF record index. */
+ sal_uInt16 InsertStyle( SfxStyleSheetBase& rStyleSheet );
+
+ /** Writes all XF records contained in this buffer. */
+ virtual void Save( XclExpStream& rStrm );
+
+private:
+ /** Converts a list index into Excel XF index. */
+ sal_uInt16 GetXclIndex( sal_uInt32 nIndex ) const;
+
+ /** Tries to find the XF record containing the passed format or inserts a new record.
+ @return The Excel XF index. */
+ sal_uInt16 InsertCellXF(
+ const ScPatternAttr* pPattern,
+ sal_uInt32 nForcedNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND,
+ bool bForceWrapped = false );
+
+ void WriteDefaultXFs5( XclExpStream& rStrm );
+ void WriteDefaultXFs8( XclExpStream& rStrm );
+
+ void WriteDefaultStyles5( XclExpStream& rStrm );
+};
+
+
// ============================================================================
#endif
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 0a0f449d5a37..c8b611391865 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xicontent.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:14 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -185,7 +185,7 @@ class XclImpValidation : ScfNoInstance
{
public:
/** Reads a DVAL record and sets marks the dropdown arrow control to be ignored. */
- static void ReadDval( XclImpStream& rStrm, XclImpRoot& rRoot );
+ static void ReadDval( XclImpStream& rStrm );
/** Reads a DV record and inserts validation data into the document. */
static void ReadDv( XclImpStream& rStrm, ExcelToSc& rFmlaConv );
};
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index 56cb73fc453c..182dfb995f1d 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xihelper.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:14 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:11 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -168,8 +168,10 @@ struct XclFontData;
&N page count
&D current date
&T current time
- &F file name without path (converted to full file name)
&A table name
+ &F file name without path (see also &Z&F)
+ &Z file path without file name (converted to full file name, see also &Z&F)
+ &Z&F file path and name
&U underlining on/off
&E double underlining on/off
&S strikeout characters on/off
@@ -179,7 +181,6 @@ struct XclFontData;
&fontheight set font height in points ('fontheight' is a decimal value)
Known but unsupported control sequences:
- &Z file path without file name
&G picture
*/
class XclImpHFConverter : protected XclImpRoot, ScfNoCopy
diff --git a/sc/source/filter/inc/xilink.hxx b/sc/source/filter/inc/xilink.hxx
index b04a4567f01a..e0561886b91a 100644
--- a/sc/source/filter/inc/xilink.hxx
+++ b/sc/source/filter/inc/xilink.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xilink.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:15 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -128,6 +128,7 @@ class XclImpExtName
{
private:
String maName; /// The name of the external name.
+ String maAddInName; /// The converted Calc add-in function name.
sal_uInt32 mnStorageId; /// Storage ID for OLE object storages.
XclImpExtNameType meType; /// Type of the external name.
@@ -137,6 +138,7 @@ public:
inline XclImpExtNameType GetType() const { return meType; }
inline const String& GetName() const { return maName; }
+ inline const String& GetAddInName() const { return maAddInName; }
inline sal_uInt32 GetStorageId() const { return mnStorageId; }
};
@@ -210,6 +212,7 @@ private:
String maUrl; /// URL of the external document.
sal_uInt16 mnCurrExcTab; /// Current Excel sheet index of external cells.
bool mbSelf; /// true = internal 3D references.
+ bool mbAddIn; /// true = Add-in function names.
public:
/** Reads the SUPBOOK record from stream. */
@@ -229,6 +232,8 @@ public:
/** Returns true, if this SUPBOOK contains internal 3D references. */
inline bool IsSelf() const { return mbSelf; }
+ /** Returns true, if this SUPBOOK contains add-in function names. */
+ inline bool IsAddIn() const { return mbAddIn; }
/** Returns the URL of the external document. */
inline const String& GetUrl() const { return maUrl; }
diff --git a/sc/source/filter/inc/xiroot.hxx b/sc/source/filter/inc/xiroot.hxx
index a9df4df6d331..223703778a30 100644
--- a/sc/source/filter/inc/xiroot.hxx
+++ b/sc/source/filter/inc/xiroot.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xiroot.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,6 +79,7 @@ class XclImpXFBuffer;
class XclImpXFIndexBuffer;
class XclImpTabIdBuffer;
class XclImpLinkManager;
+class XclImpObjectManager;
class XclImpWebQueryBuffer;
/** Stores global buffers and data needed for Excel import filter. */
@@ -92,6 +93,7 @@ struct XclImpRootData : public XclRootData
typedef ::std::auto_ptr< XclImpXFIndexBuffer > XclImpXFIndexBufferPtr;
typedef ::std::auto_ptr< XclImpTabIdBuffer > XclImpTabIdBufferPtr;
typedef ::std::auto_ptr< XclImpLinkManager > XclImpLinkManagerPtr;
+ typedef ::std::auto_ptr< XclImpObjectManager > XclImpObjectManagerPtr;
typedef ::std::auto_ptr< XclImpWebQueryBuffer > XclImpWebQueryBufferPtr;
XclImpSstPtr mpSst; /// The shared string table.
@@ -105,11 +107,9 @@ struct XclImpRootData : public XclRootData
XclImpTabIdBufferPtr mpTabIdBuffer; /// Sheet creation order list.
XclImpLinkManagerPtr mpLinkManager; /// Manager for internal/external links.
+ XclImpObjectManagerPtr mpObjManager; /// All drawing objects.
XclImpWebQueryBufferPtr mpWebQBuffer; /// All web queries.
- ScfUInt32Vec maIgnoreObj; /// ID's of objects to ignore.
- bool mbIgnoreObjSorted; /// Vector of ignored objects sorted?
-
explicit XclImpRootData(
XclBiff eBiff,
ScDocument& rDocument,
@@ -132,6 +132,9 @@ public:
XclImpRoot& operator=( const XclImpRoot& rRoot );
+ /** Returns this root instance - for code readability in derived classes. */
+ inline const XclImpRoot& GetRoot() const { return *this; }
+
/** Returns the shared string table. */
XclImpSst& GetSst() const;
@@ -151,6 +154,8 @@ public:
/** Returns the link manager. */
XclImpLinkManager& GetLinkManager() const;
+ /** Returns the drawing object manager. */
+ XclImpObjectManager& GetObjectManager() const;
/** Returns the web query buffer. */
XclImpWebQueryBuffer& GetWebQueryBuffer() const;
@@ -164,11 +169,6 @@ public:
@descr See XclRoot::CheckCellRangeList for details. */
void CheckCellRangeList( ScRangeList& rRanges ) const;
- /** Sets the object with ID nObjId to be ignored on import. */
- void SetIgnoreObject( sal_uInt32 nObjId );
- /** Returns true, if the object with ID nObjId will be ignored. */
- bool IsIgnoreObject( sal_uInt32 nObjId ) const;
-
protected:
explicit XclImpRoot( XclImpRootData& rImpRootData );
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index f969713536f8..aa3396555860 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xistream.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,9 @@ Input stream class for Excel import
// Decryption =================================================================
+#define SC_XCL_USEDECR 0
+
+#if SC_XCL_USEDECR
/** Base class for BIFF stream decryption. */
class XclImpDecrypter : ScfNoCopy
{
@@ -146,6 +149,7 @@ public:
@return Count of bytes really read. */
virtual sal_uInt32 ReadDecrypt( SvStream& rStrm, void* pData, sal_uInt32 nBytes );
};
+#endif
// ============================================================================
@@ -231,14 +235,18 @@ class XclImpRoot;
class XclImpStream
{
private:
+#if SC_XCL_USEDECR
typedef ::std::auto_ptr< XclImpDecrypter > XclImpDecrypterPtr;
+#endif
typedef ScfDelStack< XclImpStreamPos > XclImpStreamPosStack;
private:
SvStream& mrStrm; /// Reference to the system input stream.
const XclImpRoot& mrRoot; /// Filter root data.
+#if SC_XCL_USEDECR
XclImpDecrypterPtr mpDecrypter; /// Provides methods to decrypt data.
+#endif
XclImpStreamPos maFirstRec; /// Start position of current record.
XclImpStreamPosStack maPosStack; /// Stack for record positions.
@@ -260,7 +268,9 @@ private:
sal_uInt32 mnRecLeft; /// Count of bytes left in current record.
bool mbCont; /// Automatic CONTINUE lookup on/off.
+#if SC_XCL_USEDECR
bool mbUseDecr; /// Usage of decryption.
+#endif
bool mbValidRec; /// Read state: false = no record available.
bool mbValid; /// Read state: false = record overread.
bool mbWarnings; /// Enable/disable assertions.
@@ -296,11 +306,13 @@ public:
@param bWarnMode false = no overread assertions. */
inline void SetWarningMode( bool bWarnMode ) { mbWarnings = bWarnMode; }
+#if SC_XCL_USEDECR
/** Enables decryption of record contents for the rest of the stream.
@descr Stream takes ownership of the decrypter object. */
void EnableDecryption( XclImpDecrypter* pDecrypter );
/** Switches usage of current decryption algorithm on/off. */
void UseDecryption( bool bUse );
+#endif
/** Pushes current position on user position stack.
@descr This stack is emptied at every start of a new record. */
@@ -452,8 +464,10 @@ public:
inline sal_uInt32 GetStreamSize() const { return mnStreamSize; }
private:
+#if SC_XCL_USEDECR
/** Initializes the key/stream offset of the decrypter. */
inline void SetDecrypterOffset( sal_uInt16 nRecSize );
+#endif
/** Reads and decrypts a sal_Int8 value. */
void ReadAtom( sal_Int8& rnValue );
@@ -605,11 +619,13 @@ inline void XclImpStream::IgnoreByteString( bool b16BitLen )
// ----------------------------------------------------------------------------
+#if SC_XCL_USEDECR
inline void XclImpStream::SetDecrypterOffset( sal_uInt16 nRecSize )
{
if( mpDecrypter.get() )
mpDecrypter->SetOffset( nRecSize );
}
+#endif
// ============================================================================
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index c5a82429e1f5..ad80a1ac0ff1 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xistyle.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:17 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,7 +99,7 @@ and a container for XF indexes for every used cell in a sheet.
/** Stores the default colors for the current BIFF version and the contents of
a PALETTE record. */
-class XclImpPalette : public XclDefaultPalette
+class XclImpPalette : public XclDefaultPalette, protected XclImpRoot
{
private:
typedef ::std::vector< ColorData > ColorDataVec;
@@ -109,6 +109,9 @@ private:
public:
explicit XclImpPalette( const XclImpRoot& rRoot );
+ /** Activates the default colors for the current BIFF version. */
+ void OnChangeBiff();
+
/** Returns the RGB color data for a (non-zero-based) Excel palette entry.
@descr First looks for a color read from file, then looks for a default color.
@param nDefault Is returned, if nothing else could be found. */
@@ -164,13 +167,12 @@ public:
inline const XclFontData& GetFontData() const { return maData; }
/** Returns true, if the font contains superscript or subscript. */
inline bool HasEscapement() const { return maData.meEscapem != xlEscNone; }
+ /** Returns the width of the '0' character on current printer (twips). */
+ long GetCharWidth() const;
/** Reads a FONT record for all BIFF versions. */
void ReadFont( XclImpStream& rStrm );
- /** Calculates a column scaling factor using the current printer settings. */
- double CalcColumnScale() const;
-
/** Fills all font properties to the item set.
@param rItemSet The destination item set.
@param eMode The type of which IDs. */
@@ -217,13 +219,16 @@ class XclImpFontBuffer : protected XclImpRoot, ScfNoCopy
{
private:
ScfDelList< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
+ XclFontData maAppFont; /// Application font (for column width).
public:
- inline explicit XclImpFontBuffer( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ) {}
+ explicit XclImpFontBuffer( const XclImpRoot& rRoot );
/** Returns the object that stores all contents of a FONT record. */
inline const XclImpFont* GetFont( sal_uInt16 nFontIndex ) const
{ return maFontList.GetObject( nFontIndex ); }
+ /** Returns the application font data of this file, needed i.e. for column width. */
+ inline const XclFontData& GetAppFontData() const { return maAppFont; }
/** Reads a FONT record. */
void ReadFont( XclImpStream& rStrm );
@@ -246,7 +251,7 @@ class XclImpNumFmtBuffer : protected XclImpRoot, ScfNoCopy
{
private:
ScfUInt32Vec maKeyVec; /// Array of SvNumberFomatter format keys.
- sal_uInt32 mnDefault; /// Key for default format.
+ sal_uInt32 mnStdFmt; /// Key for standard number format.
public:
explicit XclImpNumFmtBuffer( const XclImpRoot& rRoot );
@@ -269,40 +274,66 @@ private:
// XF, STYLE record - Cell formatting =========================================
-struct XclImpXFBorder;
-struct XclImpXFArea;
+/** Contains color and line style for each cell border line. */
+struct XclImpXFBorder
+{
+ sal_uInt16 mnLeftColor; /// Index to color for left line.
+ sal_uInt16 mnRightColor; /// Index to color for right line.
+ sal_uInt16 mnTopColor; /// Index to color for top line.
+ sal_uInt16 mnBottomColor; /// Index to color for bottom line.
+ sal_uInt8 mnLeftLine; /// Style of left line.
+ sal_uInt8 mnRightLine; /// Style of right line.
+ sal_uInt8 mnTopLine; /// Style of top line.
+ sal_uInt8 mnBottomLine; /// Style of bottom line.
+};
+
+
+// ----------------------------------------------------------------------------
+
+/** Contains background colors and pattern. */
+struct XclImpXFArea
+{
+ sal_uInt16 mnForeColor; /// Index to foreground color.
+ sal_uInt16 mnBackColor; /// Index to background color.
+ sal_uInt8 mnPattern; /// Fill pattern.
+};
+
+
+// ----------------------------------------------------------------------------
+
class SvxBorderLine;
-/** Contains all data of a XF record and an ScPatternAttr (SetItem). */
+/** Contains all data of a XF record and a Calc item set. */
class XclImpXF : protected XclImpRoot, ScfNoCopy
{
private:
typedef ::std::auto_ptr< ScPatternAttr > ScPatternAttrPtr;
- typedef ::std::auto_ptr< XclImpXFBorder > XclImpXFBorderPtr;
- typedef ::std::auto_ptr< XclImpXFArea > XclImpXFAreaPtr;
- ScPatternAttrPtr mpPattern; /// Calc SetItem.
- XclImpXFBorderPtr mpBorder; /// Border line style.
- XclImpXFAreaPtr mpArea; /// Background area style.
+ mutable ScPatternAttrPtr mpPattern; /// Calc item set.
+ XclImpXFBorder maBorder; /// Border line style.
+ XclImpXFArea maArea; /// Background area style.
XclHorAlign meHorAlign; /// Horizontal alignment.
XclVerAlign meVerAlign; /// Vertical alignment.
- XclTextWrap meWrap; /// Automatic line break.
XclTextOrient meOrient; /// Text orientation.
XclTextDirection meTextDir; /// CTL text direction.
- sal_uInt8 mnRotation; /// Rotation angle.
- sal_uInt32 mnValFormat; /// Id for value format.
- sal_uInt16 mnIndent; /// Text indent.
- sal_uInt16 mnFont; /// Index to font record.
sal_uInt16 mnParent; /// Index to parent style XF.
+ sal_uInt32 mnNumFmt; /// Id for value format.
+ sal_uInt16 mnFont; /// Index to font record.
+ sal_uInt16 mnIndent; /// Text indent.
+ sal_uInt8 mnRotation; /// Rotation angle.
- bool mbCellXF; /// true = cell XF, sal_False = style XF.
+ bool mbCellXF; /// true = cell XF, false = style XF.
bool mbLocked; /// true = cell is locked.
bool mbHidden; /// true = formulas are hidden.
- bool mbFontValid; /// mnFont != parent->mnFont?
- bool mbFmtValid; /// mnValFormat != parent->mnValFormat?
- bool mbProtValid; /// mbLocked != parent->mbLocked or mbHidden != parent->mbHidden?
+ bool mbWrapped; /// true = automatic line break.
+ bool mbProtUsed; /// true = locked/hidden flags used.
+ bool mbFontUsed; /// true = font index used.
+ bool mbFmtUsed; /// true = number format used.
+ bool mbAlignUsed; /// true = alignment used.
+ bool mbBorderUsed; /// true = border data used.
+ bool mbAreaUsed; /// true = area data used.
public:
explicit XclImpXF( const XclImpRoot& rRoot );
@@ -311,9 +342,9 @@ public:
/** Reads an XF record. */
void ReadXF( XclImpStream& rStrm );
- /** Creates a Calc SetItem containing an item set with all cell properties.
- @return A read-only reference to the SetItem stored internally. */
- const ScPatternAttr& GetPattern();
+ /** Creates a Calc item set containing an item set with all cell properties.
+ @return A read-only reference to the item set stored internally. */
+ const ScPatternAttr& GetPattern() const;
inline bool IsCellXF() const { return mbCellXF; }
inline bool IsStyleXF() const { return !IsCellXF(); }
@@ -322,34 +353,27 @@ public:
inline XclVerAlign GetVerAlign() const { return meVerAlign; }
inline sal_uInt16 GetFont() const { return mnFont; }
- /** Inserts Excel border line styles into the item set. */
+ /** Inserts the border line styles into the item set. */
static void SetBorder(
- SfxItemSet& rItemSet, const XclImpPalette& rPalette,
- sal_uInt8 nXclLeftLine, sal_uInt16 nXclLeftColor,
- sal_uInt8 nXclRightLine, sal_uInt16 nXclRightColor,
- sal_uInt8 nXclTopLine, sal_uInt16 nXclTopColor,
- sal_uInt8 nXclBottomLine, sal_uInt16 nXclBottomColor );
+ SfxItemSet& rItemSet,
+ const XclImpPalette& rPalette,
+ const XclImpXFBorder& rBorder );
- /** Inserts an Excel area style into the item set. */
+ /** Inserts the area style into the item set. */
static void SetArea(
- SfxItemSet& rItemSet, const XclImpPalette& rPalette,
- sal_uInt8 nXclPattern,
- sal_uInt16 nXclForeColor, sal_uInt16 nXclBackColor );
+ SfxItemSet& rItemSet,
+ const XclImpPalette& rPalette,
+ const XclImpXFArea& rArea );
private:
- /** Creates and returns the border data struct. */
- XclImpXFBorder& GetBorder();
- /** Creates and returns the area data struct. */
- XclImpXFArea& GetArea();
-
void ReadXF2( XclImpStream& rStrm );
void ReadXF3( XclImpStream& rStrm );
void ReadXF4( XclImpStream& rStrm );
void ReadXF5( XclImpStream& rStrm );
void ReadXF8( XclImpStream& rStrm );
- /** Creates a new border line item. */
- static SvxBorderLine* CreateBorderItem(
+ /** Creates a new border line struct from passed line style. */
+ static SvxBorderLine* CreateBorderLine(
const XclImpPalette& rPalette,
sal_uInt8 nXclLine, sal_uInt16 nXclColor );
};
@@ -363,7 +387,7 @@ class XclImpXFBuffer : protected XclImpRoot, ScfNoCopy
{
private:
ScfDelList< XclImpXF > maXFList; /// List of contents of all XF record.
- ScPatternAttr maDefPattern; /// This SetItem is used if no other could be found or created.
+ ScPatternAttr maDefPattern; /// Used if no styles could be found or created.
public:
explicit XclImpXFBuffer( const XclImpRoot& rRoot );
@@ -373,9 +397,9 @@ public:
/** Reads a STYLE record. */
void ReadStyle( XclImpStream& rStrm );
- /** Creates a SetItem with all properties stored in the XF record.
- @return A read-only reference to the SetItem stored internally. */
- const ScPatternAttr& GetPattern( sal_uInt32 nXFIndex );
+ /** Creates a item set with all properties stored in the XF record.
+ @return A read-only reference to the item set stored internally. */
+ const ScPatternAttr& GetPattern( sal_uInt32 nXFIndex ) const;
/** Returns the object that stores all contents of an XF record. */
inline const XclImpXF* GetXF( sal_uInt32 nXFIndex ) const
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index 3106b6858bd3..b09227458898 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xlconst.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -145,15 +145,25 @@ const sal_Int32 EXC_POINTS_PER_INCH = 72;
const sal_Int32 EXC_TWIPS_PER_INCH = EXC_POINTS_PER_INCH * 20;
+// Line styles ----------------------------------------------------------------
+
+const sal_uInt8 EXC_LINE_NONE = 0x00;
+const sal_uInt8 EXC_LINE_THIN = 0x01;
+const sal_uInt8 EXC_LINE_MEDIUM = 0x02;
+const sal_uInt8 EXC_LINE_THICK = 0x05;
+const sal_uInt8 EXC_LINE_DOUBLE = 0x06;
+const sal_uInt8 EXC_LINE_HAIR = 0x07;
+
+
// Background patterns --------------------------------------------------------
-const sal_uInt16 EXC_PATT_NONE = 0x0000;
-const sal_uInt16 EXC_PATT_SOLID = 0x0001;
-const sal_uInt16 EXC_PATT_50_PERC = 0x0002;
-const sal_uInt16 EXC_PATT_75_PERC = 0x0003;
-const sal_uInt16 EXC_PATT_25_PERC = 0x0004;
-const sal_uInt16 EXC_PATT_12_5_PERC = 0x0011;
-const sal_uInt16 EXC_PATT_6_25_PERC = 0x0012;
+const sal_uInt8 EXC_PATT_NONE = 0x00;
+const sal_uInt8 EXC_PATT_SOLID = 0x01;
+const sal_uInt8 EXC_PATT_50_PERC = 0x02;
+const sal_uInt8 EXC_PATT_75_PERC = 0x03;
+const sal_uInt8 EXC_PATT_25_PERC = 0x04;
+const sal_uInt8 EXC_PATT_12_5_PERC = 0x11;
+const sal_uInt8 EXC_PATT_6_25_PERC = 0x12;
// Miscellaneous ---------------------------------------------------------------
@@ -164,6 +174,11 @@ const sal_Unicode EXC_NEWLINE = EXC_NEWLINE_CHAR;
// Records (ordered by lowest record ID) ======================================
+// (0x0007, 0x0207) STRING ----------------------------------------------------
+
+const sal_uInt16 EXC_ID_STRING = 0x0207;
+
+
// (0x0014, 0x0015) HEADER, FOOTER --------------------------------------------
const sal_uInt16 EXC_ID_HEADER = 0x0014;
@@ -211,6 +226,12 @@ const sal_uInt16 EXC_ID_VERTPAGEBREAKS = 0x001A;
const sal_uInt16 EXC_ID_HORPAGEBREAKS = 0x001B;
+// (0x001C) NOTE --------------------------------------------------------------
+
+const sal_uInt16 EXC_ID_NOTE = 0x001C;
+const sal_uInt16 EXC_NOTE_VISIBLE = 0x0002;
+
+
// (0x001E, 0x041E) FORMAT ----------------------------------------------------
const sal_uInt16 EXC_ID_FORMAT = 0x041E;
@@ -300,26 +321,43 @@ const sal_uInt8 EXC_FONTCSET_SYMBOL = 0x02;
const sal_uInt16 EXC_FONT_AUTOCOLOR = 0x7FFF;
-// (0x0043, 0x00E0) XF --------------------------------------------------------
+// (0x0043, 0x0243, 0x0443, 0x00E0) XF ----------------------------------------
+
+const sal_uInt16 EXC_ID2_XF = 0x0043;
+const sal_uInt16 EXC_ID3_XF = 0x0243;
+const sal_uInt16 EXC_ID4_XF = 0x0443;
+const sal_uInt16 EXC_ID_XF = 0x00E0;
+
+const sal_uInt16 EXC_XF_OFFSET = 21; /// Index to first user defined record.
+const sal_uInt32 EXC_XF_MAXCOUNT = 4029; /// Maximum number of user defined records.
+const sal_uInt16 EXC_XF_DEFAULTSTYLE = 0; /// Excel index to cefault style XF.
+const sal_uInt16 EXC_XF_DEFAULTCELL = 15; /// Excel index to cefault cell XF.
const sal_uInt16 EXC_XF_LOCKED = 0x0001;
const sal_uInt16 EXC_XF_HIDDEN = 0x0002;
const sal_uInt16 EXC_XF_STYLE = 0x0004;
+const sal_uInt16 EXC_XF_STYLEPARENT = 0x0FFF; /// Syles don't have a parent.
+const sal_uInt16 EXC_XF_WRAPPED = 0x0008; /// Automatic line break.
-const sal_uInt16 EXC_XF_DIFF_VALFMT = 0x0400;
-const sal_uInt16 EXC_XF_DIFF_FONT = 0x0800;
-const sal_uInt16 EXC_XF_DIFF_ALIGN = 0x1000;
-const sal_uInt16 EXC_XF_DIFF_BORDER = 0x2000;
-const sal_uInt16 EXC_XF_DIFF_AREA = 0x4000;
-const sal_uInt16 EXC_XF_DIFF_PROT = 0x8000;
+const sal_uInt8 EXC_XF_DIFF_VALFMT = 0x01;
+const sal_uInt8 EXC_XF_DIFF_FONT = 0x02;
+const sal_uInt8 EXC_XF_DIFF_ALIGN = 0x04;
+const sal_uInt8 EXC_XF_DIFF_BORDER = 0x08;
+const sal_uInt8 EXC_XF_DIFF_AREA = 0x10;
+const sal_uInt8 EXC_XF_DIFF_PROT = 0x20;
const sal_uInt8 EXC_XF2_VALFMT_MASK = 0x3F;
const sal_uInt8 EXC_XF2_LOCKED = 0x40;
const sal_uInt8 EXC_XF2_HIDDEN = 0x80;
+const sal_uInt8 EXC_XF2_LEFTLINE = 0x08;
+const sal_uInt8 EXC_XF2_RIGHTLINE = 0x10;
+const sal_uInt8 EXC_XF2_TOPLINE = 0x20;
+const sal_uInt8 EXC_XF2_BOTTOMLINE = 0x40;
const sal_uInt8 EXC_XF2_BACKGROUND = 0x80;
const sal_uInt16 EXC_XF8_SHRINKTOFIT = 0x0010;
const sal_uInt16 EXC_XF8_MERGE = 0x0020;
+const sal_uInt8 EXC_XF8_STACKED = 0xFF; /// Special rotation angle.
// (0x0059, 0x005A) XCT, CRN --------------------------------------------------
@@ -364,12 +402,6 @@ const sal_uInt16 EXC_COLOR_BIFF2_BLACK = 0;
const sal_uInt16 EXC_COLOR_BIFF2_WHITE = 1;
-// (0x0093) STYLE -------------------------------------------------------------
-
-const sal_uInt16 EXC_STYLE_BUILTIN = 0x8000;
-const sal_uInt16 EXC_STYLE_MASK = 0x0FFF;
-
-
// (0x00E9) BITMAP ------------------------------------------------------------
const sal_uInt16 EXC_ID_BITMAP = 0x00E9;
@@ -459,6 +491,13 @@ const sal_uInt32 EXC_HLINK_FRAME = 0x00000080; /// Target frame.
const sal_uInt32 EXC_HLINK_UNC = 0x00000100; /// UNC path.
+// (0x0293) STYLE -------------------------------------------------------------
+
+const sal_uInt16 EXC_ID_STYLE = 0x0293;
+const sal_uInt16 EXC_STYLE_BUILTIN = 0x8000;
+const sal_uInt16 EXC_STYLE_MASK = 0x0FFF;
+
+
// web queries ================================================================
#define EXC_WEBQRY_FILTER "calc_HTML_WebQuery"
diff --git a/sc/source/filter/inc/xlocx.hxx b/sc/source/filter/inc/xlocx.hxx
new file mode 100644
index 000000000000..9c26776c03ae
--- /dev/null
+++ b/sc/source/filter/inc/xlocx.hxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * $RCSfile: xlocx.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:13 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// ============================================================================
+
+#ifndef SC_XLOCX_HXX
+#define SC_XLOCX_HXX
+
+#ifndef _MSOCXIMEX_HXX
+#include
+#endif
+
+#ifndef SC_XLROOT_HXX
+#include "xlroot.hxx"
+#endif
+
+const int EXC_INCL_EXP_OCX = 1; /// 1 = Compile with OCX export.
+
+// OCX controls ===============================================================
+
+/** Converter base class for import and export of OXC controls.
+ @descr The purpose of this class is to manage all the draw pages occuring in a
+ spreadsheet document. Derived classes implement import or export of the controls. */
+class XclOcxConverter : protected SvxMSConvertOCXControls, public XclRoot
+{
+protected:
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > XFormComponentRef;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > XShapeRef;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > XDrawPageRef;
+
+private:
+ sal_uInt16 mnCurrTab; /// Stores sheet index of an object for GetDrawPage().
+ sal_uInt16 mnCachedTab; /// Sheet index of cached draw page.
+
+protected:
+ explicit XclOcxConverter( const XclRoot& rRoot );
+ virtual ~XclOcxConverter();
+
+ /** Sets the sheet index of the currently processed object. GetDrawPage() needs this. */
+ void SetCurrTab( sal_uInt16 nTab );
+
+private:
+ /** Returns the current draw page. */
+ virtual const XDrawPageRef& GetDrawPage();
+};
+
+
+// ----------------------------------------------------------------------------
+
+class XclImpEscherOle;
+
+/** Converter for import of OXC controls. */
+class XclImpOcxConverter : public XclOcxConverter
+{
+private:
+ SvStorageStreamRef mxStrm; /// The 'Ctls' strem.
+
+public:
+ explicit XclImpOcxConverter( const XclRoot& rRoot );
+
+ /** Reads the form control data of the passed control object and creates it in the document. */
+ void ReadControl( XclImpEscherOle& rObj );
+
+private:
+ /** Inserts the passed control rxFComp into the document. */
+ virtual sal_Bool InsertControl(
+ const XFormComponentRef& rxFComp,
+ const ::com::sun::star::awt::Size& rSize,
+ XShapeRef* pxShape,
+ BOOL bFloatingCtrl );
+};
+
+
+// ----------------------------------------------------------------------------
+
+#if EXC_INCL_EXP_OCX
+
+class SdrObject;
+class XclExpObjControl;
+
+/** Converter for export of OXC controls. */
+class XclExpOcxConverter : public XclOcxConverter
+{
+private:
+ SvStorageStreamRef mxStrm; /// The 'Ctls' stream.
+
+public:
+ explicit XclExpOcxConverter( const XclRoot& rRoot );
+
+ /** Creates an OBJ record for the passed form control object.
+ @descr Writes the form control data to the 'Ctls' stream. */
+ XclExpObjControl* CreateObjRec( const XShapeRef& rxShape );
+};
+
+#endif
+
+// ============================================================================
+
+#endif
+
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index c2d067759f03..8133821cee92 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xlroot.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:18 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,6 +95,7 @@ struct XclRootData
LanguageType meLang; /// Document language.
ScAddress maScMaxPos; /// Highest Calc cell position.
ScAddress maXclMaxPos; /// Highest Excel cell position.
+ long mnCharWidth; /// Width of '0' in default font (twips).
sal_uInt16 mnScTab; /// Current Calc sheet index.
bool mbTruncated; /// Flag for the table truncated warning box.
@@ -104,6 +105,10 @@ struct XclRootData
::std::auto_ptr< RootData > mpRDP;//!
+#ifdef DBG_UTIL
+ sal_Int32 mnObjCnt; /// Object counter for mem leak tests.
+#endif
+
explicit XclRootData(
XclBiff eBiff,
ScDocument& rDocument,
@@ -120,8 +125,10 @@ class ScModelObj;
class SfxPrinter;
class SvNumberFormatter;
class ScRangeName;
+class SvStorage;
-/** Access to global data from other classes. */
+/** Access to global data for a filter object (imported or exported document)
+ from other classes. */
class XclRoot
{
private:
@@ -135,6 +142,8 @@ public:
RootData* mpRD;//!
+ /** Returns this root instance - for code readability in derived classes. */
+ inline const XclRoot& GetRoot() const { return *this; }
/** Returns the current BIFF version of the importer/exporter. */
inline XclBiff GetBiff() const { return mrData.meBiff; }
/** Returns the document language. */
@@ -150,9 +159,13 @@ public:
inline const String& GetBasePath() const { return mrData.maBasePath; }
/** Returns the character set to import/export byte strings. */
inline CharSet GetCharSet() const { return mrData.meCharSet; }
+ /** Returns the width of the '0' character (default font) for the current printer (twips). */
+ inline long GetCharWidth() const { return mrData.mnCharWidth; }
/** Returns the destination document (import) or source document (export). */
inline ScDocument& GetDoc() const { return mrData.mrDoc; }
+ /** Returns pointer to the destination document (import) or source document (export). */
+ inline ScDocument* GetDocPtr() const { return &mrData.mrDoc; }
/** Returns the object shell of the Calc document. May be NULL (i.e. import from clipboard). */
SfxObjectShell* GetDocShell() const;
/** Returns the object model of the Calc document. */
@@ -164,6 +177,10 @@ public:
/** Returns the defined names container of the Calc document. */
ScRangeName& GetNamedRanges() const;
+ /** Returns the OLE2 root storage of the imported/exported file.
+ @return Pointer to root storage or 0, if the file is a simple stream. */
+ SvStorage* GetRootStorage() const;
+
/** Returns the edit engine for import/export of rich strings etc. */
ScEditEngineDefaulter& GetEditEngine() const;
/** Returns the edit engine for import/export of headers/footers. */
@@ -186,6 +203,8 @@ protected:
inline void SetLanguage( LanguageType eLang ) { mrData.meLang = eLang; }
/** Sets the character set to import/export byte strings. */
inline void SetCharSet( CharSet eCharSet ) { mrData.meCharSet = eCharSet; }
+ /** Sets the width of the '0' character (default font) for the current printer (twips). */
+ inline void SetCharWidth( long nCharWidth ) { mrData.mnCharWidth = nCharWidth; }
/** Increases the current Calc sheet index by 1. */
inline void IncScTab() { ++mrData.mnScTab; }
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index c974559c4cc7..7cfccacfc9e2 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xlstyle.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:11:18 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,7 +72,7 @@
// Color data =================================================================
/** Stores all default colors for a specific BIFF version. */
-class XclDefaultPalette : ScfNoCopy
+class XclDefaultPalette
{
private:
const ColorData* mpColorTable; /// The table with RGB values.
@@ -83,7 +83,7 @@ public:
explicit XclDefaultPalette( XclBiff eBiff = xlBiffUnknown );
/** Activates the default colors for the passed BIFF version. */
- void SetBiff( XclBiff eBiff );
+ void SetDefaultColors( XclBiff eBiff );
/** Returns the color count in the current palette. */
inline sal_uInt32 GetColorCount() const { return mnTableSize; }
@@ -110,7 +110,7 @@ inline Color XclDefaultPalette::GetDefColor( sal_uInt16 nXclIndex, ColorData nDe
}
-// Font Data ==================================================================
+// Font data ==================================================================
/** Text underline style. */
enum XclUnderline
@@ -172,7 +172,7 @@ enum XclHorAlign
xlHAlignFill = 0x04,
xlHAlignJustify = 0x05,
xlHAlignCenterAcrSel = 0x06,
- xlHAlignParent = 0xFF
+ xlHAlignDistrib = 0x07
};
/** Vertical alignment of cell contents. */
@@ -182,8 +182,7 @@ enum XclVerAlign
xlVAlignCenter = 0x01,
xlVAlignBottom = 0x02,
xlVAlignJustify = 0x03,
- xlVAlignDistrib = 0x04,
- xlVAlignParent = 0xFF
+ xlVAlignDistrib = 0x04
};
/** Text orientation. */
@@ -193,16 +192,7 @@ enum XclTextOrient
xlTextOrientTopBottom = 0x01,
xlTextOrient90ccw = 0x02,
xlTextOrient90cw = 0x03,
- xlTextOrientRot = 0x04,
- xlTextOrientParent = 0xFF
-};
-
-/** Text wrap (automatic line break). */
-enum XclTextWrap
-{
- xlTextWrapNo = 0x00,
- xlTextWrapYes = 0x01,
- xlTextWrapParent = 0xFF
+ xlTextOrientRot = 0x04
};
/** CTL text direction. */
@@ -210,8 +200,7 @@ enum XclTextDirection
{
xlTextDirContext = 0x00,
xlTextDirLTR = 0x01,
- xlTextDirRTL = 0x02,
- xlTextDirParent = 0xFF
+ xlTextDirRTL = 0x02
};
diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx
index 195e11382a71..8027132e6fcc 100644
--- a/sc/source/filter/inc/xltools.hxx
+++ b/sc/source/filter/inc/xltools.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xltools.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:41:09 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,7 +81,7 @@
/** An enumeration for all Excel file format types (BIFF types). */
enum XclBiff
{
- xlBiff2, /// MS Excel 2.1
+ xlBiff2 = 0, /// MS Excel 2.1
xlBiff3, /// MS Excel 3.x
xlBiff4, /// MS Excel 4.x
xlBiff5, /// MS Excel 5.x
@@ -117,14 +117,12 @@ enum XclBoolError
class XclImpStream;
class XclExpStream;
-/** This struct stores a GUID (class ID) and supports reading, writing and
- comparison. */
+/** This struct stores a GUID (class ID) and supports reading, writing and comparison. */
struct XclGuid
{
- sal_uInt8 mpData[ 16 ];
+ sal_uInt8 mpData[ 16 ]; /// Stores GUID always in little endian.
explicit XclGuid();
- XclGuid( const XclGuid& rSrc );
explicit XclGuid(
sal_uInt32 nData1,
sal_uInt16 nData2, sal_uInt16 nData3,
@@ -132,8 +130,6 @@ struct XclGuid
sal_uInt8 nData43, sal_uInt8 nData44,
sal_uInt8 nData45, sal_uInt8 nData46,
sal_uInt8 nData47, sal_uInt8 nData48 );
-
- XclGuid& operator=( const XclGuid& rSrc );
};
bool operator==( const XclGuid& rCmp1, const XclGuid& rCmp2 );
@@ -172,9 +168,9 @@ public:
static bool GetRKFromDouble( sal_Int32& rnRKValue, double fValue );
/** Calculates an angle (in 1/100 of degrees) from an Excel angle value. */
- static sal_Int32 GetScRotation( sal_uInt16 nExcRot );
+ static sal_Int32 GetScRotation( sal_uInt16 nXclRot );
/** Calculates the Excel angle value from an angle in 1/100 of degrees. */
- static sal_uInt16 GetExcRotation( sal_Int32 nScRot );
+ static sal_uInt8 GetXclRotation( sal_Int32 nScRot );
/** Gets a translated error code or Boolean value from Excel error codes.
@param rfDblValue Returns 0.0 for error codes or the value of a Boolean (0.0 or 1.0).
@@ -192,6 +188,13 @@ public:
/** Returns the length in inches calculated from a length in twips. */
static double GetInchFromTwips( sal_uInt16 nTwips );
+ /** Returns the Calc column width (twips) for the passed Excel width.
+ @param nScCharWidth Width of the '0' character in Calc (twips). */
+ static sal_uInt16 GetScColumnWidth( sal_uInt16 nXclWidth, long nScCharWidth );
+ /** Returns the Excel column width for the passed Calc width (twips).
+ @param nScCharWidth Width of the '0' character in Calc (twips). */
+ static sal_uInt16 GetXclColumnWidth( sal_uInt16 nScWidth, long nScCharWidth );
+
// built-in names -------------------------------------------------------------
/** Returns an Excel built-in name used in NAME records. */
diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx
index 56f8f8c6fea7..9fb48aaf750a 100644
--- a/sc/source/filter/lotus/filter.cxx
+++ b/sc/source/filter/lotus/filter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filter.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:45:14 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,7 +78,6 @@
#include "compiler.hxx"
#include "scerrors.hxx"
-#include "fltprgrs.hxx"
#include "root.hxx"
#include "lotrange.hxx"
#include "optab.h"
@@ -86,6 +85,11 @@
#include "decl.h"
#include "tool.h"
+#ifndef SC_FPROGRESSBAR_HXX
+#include "fprogressbar.hxx"
+#endif
+
+
// Konstanten ------------------------------------------------------------
const UINT16 nBOF = 0x0000;
@@ -144,7 +148,7 @@ FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, CharSet
InitPage(); // Seitenformat initialisieren (nur Tab 0!)
// Progressbar starten
- FilterProgressBar aPrgrsBar( aStream );
+ ScfStreamProgressBar aPrgrsBar( aStream, pDocument->GetDocumentShell() );
// Datei-Typ ermitteln
eTyp = ScanVersion( aStream );
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 595eb9c213bf..db2a7c0f12f6 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lotform.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:21:24 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 9009abc033e8..523a6e95c030 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lotimpop.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:21:24 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index afcb7bfa51c0..e5c6ade5154e 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lotread.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: vg $ $Date: 2001-05-18 12:28:04 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,9 +72,12 @@
#include "scerrors.hxx"
#include "root.hxx"
#include "lotimpop.hxx"
-#include "fltprgrs.hxx"
#include "lotattr.hxx"
+#ifndef SC_FPROGRESSBAR_HXX
+#include "fprogressbar.hxx"
+#endif
+
class ScFormulaCell;
@@ -106,7 +109,7 @@ FltError ImportLotus::Read()
pIn->Seek( nNextRec );
// Progressbar starten
- FilterProgressBar aPrgrsBar( *pIn );
+ ScfStreamProgressBar aPrgrsBar( *pIn, pD->GetDocumentShell() );
while( eAkt != S_END )
{
@@ -292,7 +295,7 @@ FltError ImportLotus::Read( SvStream& rIn )
pIn->Seek( nNextRec );
// Progressbar starten
- FilterProgressBar aPrgrsBar( *pIn );
+ ScfStreamProgressBar aPrgrsBar( *pIn, pD->GetDocumentShell() );
while( bRead )
{
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 81c1069e9498..156a3ec5afa2 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: op.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: er $ $Date: 2002-12-06 17:47:41 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,7 +68,7 @@
//------------------------------------------------------------------------
#include
-#include
+#include
#include
#include
#include
@@ -150,7 +150,7 @@ void OP_Number( SvStream& r, UINT16 n )
r >> nFormat >> nCol >> nRow >> fValue;
- fValue = SolarMath::Round( fValue, 15 );
+ fValue = ::rtl::math::round( fValue, 15 );
ScValueCell* pZelle = new ScValueCell( fValue );
pDoc->PutCell( nCol, nRow, nTab, pZelle, ( BOOL ) TRUE );
@@ -275,7 +275,7 @@ void OP_NamedRange( SvStream& r, UINT16 n )
String aTmp( pAnsi, pLotusRoot->eCharsetQ );
- ScfTools::ConvertName( aTmp );
+ ScfTools::ConvertToScDefinedName( aTmp );
pLotusRoot->pRangeNames->Append( pRange, aTmp );
}
@@ -313,7 +313,7 @@ void OP_SymphNamedRange( SvStream& r, UINT16 n )
DosToSystem( pAnsi );
String aTmp( pAnsi, pLotusRoot->eCharsetQ );
- ScfTools::ConvertName( aTmp );
+ ScfTools::ConvertToScDefinedName( aTmp );
pLotusRoot->pRangeNames->Append( pRange, aTmp );
}
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index 3c125df9ee02..ad40e615d7d7 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tool.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:21:25 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -601,7 +601,7 @@ void RangeNameBufferWK3::Add( const String& rOrgName, const ComplRefData& rCRD )
static UINT16 nDouble = 0;
String aScName( rOrgName );
- ScfTools::ConvertName( aScName );
+ ScfTools::ConvertToScDefinedName( aScName );
register ENTRY* pInsert = new ENTRY( rOrgName, aScName, rCRD );
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index c7704308f5d5..84dbf893c766 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: eeimpars.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: er $ $Date: 2002-11-12 18:24:26 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,7 +166,7 @@ ULONG ScEEImport::Read( SvStream& rStream )
void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
{
- ScProgress* pProgress = new ScProgress( NULL,
+ ScProgress* pProgress = new ScProgress( pDoc->GetDocumentShell(),
ScGlobal::GetRscString( STR_LOAD_DOC ), pParser->Count() );
ULONG nProgress = 0;
@@ -369,7 +369,16 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
}
else
{
- String aStr( pEngine->GetText( pE->aSel.nStartPara ) );
+ String aStr;
+ if( pE->bEntirePara )
+ {
+ aStr = pEngine->GetText( pE->aSel.nStartPara );
+ }
+ else
+ {
+ aStr = pEngine->GetText( pE->aSel );
+ aStr.EraseLeadingAndTrailingChars();
+ }
const sal_Unicode cDecSepEng = '.';
const sal_Unicode cThoSepEng = ',';
if ( cDecSep != cDecSepEng
@@ -411,6 +420,12 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor )
}
}
}
+
+ // #105460#, #i4180# String cells can't contain tabs or linebreaks
+ // -> replace with spaces
+ aStr.SearchAndReplaceAll( (sal_Unicode)'\t', (sal_Unicode)' ' );
+ aStr.SearchAndReplaceAll( (sal_Unicode)'\n', (sal_Unicode)' ' );
+
pDoc->SetString( nCol, nRow, nTab, aStr );
}
}
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index c77fcb23e2c7..f3430c2e0b73 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scflt.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: er $ $Date: 2002-12-06 17:52:08 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -113,10 +113,13 @@
#include "scfobj.hxx"
#include "docoptio.hxx"
#include "viewopti.hxx"
-#include "fltprgrs.hxx"
#include "globstr.hrc"
#include "ftools.hxx"
+#ifndef SC_FPROGRESSBAR_HXX
+#include "fprogressbar.hxx"
+#endif
+
using namespace com::sun::star;
@@ -1070,7 +1073,7 @@ Sc10Import::~Sc10Import()
ULONG Sc10Import::Import()
{
- pPrgrsBar = new FilterProgressBar( rStream );
+ pPrgrsBar = new ScfStreamProgressBar( rStream, pDoc->GetDocumentShell() );
ScDocOptions aOpt = pDoc->GetDocOptions();
aOpt.SetDate( 1, 1, 1900 );
@@ -1079,19 +1082,19 @@ ULONG Sc10Import::Import()
pDoc->GetFormatTable()->ChangeNullDate( 1, 1, 1900 );
LoadFileHeader(); pPrgrsBar->Progress();
- if (!nError) { LoadFileInfo(); pPrgrsBar->Progress(); }
- if (!nError) { LoadEditStateInfo(); pPrgrsBar->Progress(); }
+ if (!nError) { LoadFileInfo(); pPrgrsBar->Progress(); }
+ if (!nError) { LoadEditStateInfo(); pPrgrsBar->Progress(); }
if (!nError) { LoadProtect(); pPrgrsBar->Progress(); }
- if (!nError) { LoadViewColRowBar(); pPrgrsBar->Progress(); }
+ if (!nError) { LoadViewColRowBar(); pPrgrsBar->Progress(); }
if (!nError) { LoadScrZoom(); pPrgrsBar->Progress(); }
if (!nError) { LoadPalette(); pPrgrsBar->Progress(); }
if (!nError) { LoadFontCollection(); pPrgrsBar->Progress(); }
if (!nError) { LoadNameCollection(); pPrgrsBar->Progress(); }
- if (!nError) { LoadPatternCollection(); pPrgrsBar->Progress(); }
+ if (!nError) { LoadPatternCollection(); pPrgrsBar->Progress(); }
if (!nError) { LoadDataBaseCollection(); pPrgrsBar->Progress(); }
if (!nError) { LoadTables(); pPrgrsBar->Progress(); }
if (!nError) { LoadObjects(); pPrgrsBar->Progress(); }
- if (!nError) { ImportNameCollection(); pPrgrsBar->Progress(); }
+ if (!nError) { ImportNameCollection(); pPrgrsBar->Progress(); }
pDoc->SetViewOptions( aSc30ViewOpt );
#ifdef DBG_UTIL
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 0dc9838b6413..4ef8d9af53f6 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XclExpChangeTrack.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:42:28 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index 0840b12cd09c..731b60720780 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XclImpChangeTrack.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dr $ $Date: 2002-11-21 12:22:29 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/xcl97/makefile.mk b/sc/source/filter/xcl97/makefile.mk
index c5296d01b87c..6a2a4b405e06 100644
--- a/sc/source/filter/xcl97/makefile.mk
+++ b/sc/source/filter/xcl97/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.10 $
+# $Revision: 1.11 $
#
-# last change: $Author: dr $ $Date: 2002-11-21 12:22:29 $
+# last change: $Author: hr $ $Date: 2003-03-26 18:05:34 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -89,6 +89,7 @@ SLOFILES = \
$(SLO)$/XclExpPivotTables.obj \
$(SLO)$/XclExpChangeTrack.obj
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sc/source/filter/xcl97/xcl97dum.cxx b/sc/source/filter/xcl97/xcl97dum.cxx
index e5ac815de071..4247bfc20e2b 100644
--- a/sc/source/filter/xcl97/xcl97dum.cxx
+++ b/sc/source/filter/xcl97/xcl97dum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97dum.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: dr $ $Date: 2002-12-06 16:42:29 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -127,107 +127,6 @@ const BYTE ExcDummy8_041::pMyData[] = {
const ULONG ExcDummy8_041::nMyLen = sizeof(ExcDummy8_041::pMyData);
-// 21 default XF Records (8*)
-const BYTE ExcDummy8_XF::pMyData[] = {
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x2B, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x29, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x09, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x2C, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20,
-
- 0xe0, 0x00, 0x14, 0x00,
- 0x01, 0x00, 0x2A, 0x00, 0xF5, 0xFF, 0x20, 0x00,
- 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x20
-
-};
-const ULONG ExcDummy8_XF::nMyLen = sizeof(ExcDummy8_XF::pMyData);
-
-
-// 6 default STYLE Records (8*)
-const BYTE ExcDummy8_Style::pMyData[] = {
- 0x93, 0x02, 0x04, 0x00, 0x10, 0x80, 0x03, 0xFF,
- 0x93, 0x02, 0x04, 0x00, 0x11, 0x80, 0x06, 0xFF,
- 0x93, 0x02, 0x04, 0x00, 0x12, 0x80, 0x05, 0xFF,
- 0x93, 0x02, 0x04, 0x00, 0x00, 0x80, 0x00, 0xFF,
- 0x93, 0x02, 0x04, 0x00, 0x13, 0x80, 0x04, 0xFF,
- 0x93, 0x02, 0x04, 0x00, 0x14, 0x80, 0x07, 0xFF
-};
-const ULONG ExcDummy8_Style::nMyLen = sizeof(ExcDummy8_Style::pMyData);
-
// Natural Language Formulas Flag (8+) 0 := nein, 1:= ja
const BYTE ExcDummy8_UsesElfs::pMyData[] = {
@@ -309,32 +208,6 @@ const BYTE* ExcDummy8_041::GetData() const
-ULONG ExcDummy8_XF::GetLen() const
-{
- return nMyLen;
-}
-
-
-const BYTE* ExcDummy8_XF::GetData() const
-{
- return pMyData;
-}
-
-
-
-ULONG ExcDummy8_Style::GetLen() const
-{
- return nMyLen;
-}
-
-
-const BYTE* ExcDummy8_Style::GetData() const
-{
- return pMyData;
-}
-
-
-
ULONG ExcDummy8_UsesElfs::GetLen() const
{
return nMyLen;
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 3566c0463c23..4cff3d99a5b7 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97esc.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dr $ $Date: 2002-12-12 13:14:21 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,6 +81,9 @@
#ifndef _SVDOOLE2_HXX //autogen wg. SdrOle2Obj
#include
#endif
+#ifndef _SVX_FMGLOB_HXX
+#include
+#endif
#ifndef _IPOBJ_HXX //autogen wg. SvInPlaceObject
#include
#endif
@@ -113,6 +116,9 @@
XclEscherEx::XclEscherEx( SvStream& rStrm, UINT32 nDrawings, RootData& rRoot )
:
EscherEx( rStrm, nDrawings ),
+#if EXC_INCL_EXP_OCX
+ aOcxConverter( *rRoot.pER ),
+#endif
rRootData( rRoot ),
pPicTempFile( NULL ),
pPicStrm( NULL ),
@@ -218,30 +224,41 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
pCurrXclObj = new XclObjAny( rRootData ); // just what is it?!?
else
{
- switch ( pObj->GetObjIdentifier() )
+ pCurrXclObj = NULL;
+ sal_uInt16 nObjType = pObj->GetObjIdentifier();
+
+ if( nObjType == OBJ_OLE2 )
{
- case OBJ_OLE2 :
+ //! not-const because GetObjRef may load the OLE object
+ SvInPlaceObjectRef xObj( ((SdrOle2Obj*)pObj)->GetObjRef() );
+ if ( xObj.Is() )
{
- //! not-const because GetObjRef may load the OLE object
- SvInPlaceObjectRef xObj( ((SdrOle2Obj*)pObj)->GetObjRef() );
- if ( xObj.Is() )
- {
- SvGlobalName aObjClsId( *xObj->GetSvFactory() );
- if ( SchModuleDummy::HasID( aObjClsId ) )
- { // yes, it's a chart diagram
- rRootData.pObjRecs->Add( new XclObjChart( rRootData, rShape ) );
- pCurrXclObj = NULL; // no metafile or whatsoever
- }
- else // metafile and OLE object
- pCurrXclObj = new XclObjOle( rRootData, *pObj );
+ SvGlobalName aObjClsId( *xObj->GetSvFactory() );
+ if ( SchModuleDummy::HasID( aObjClsId ) )
+ { // yes, it's a chart diagram
+ rRootData.pObjRecs->Add( new XclObjChart( rRootData, rShape ) );
+ pCurrXclObj = NULL; // no metafile or whatsoever
}
- else // just a metafile
- pCurrXclObj = new XclObjAny( rRootData );
+ else // metafile and OLE object
+ pCurrXclObj = new XclObjOle( rRootData, *pObj );
}
- break;
- default:
+ else // just a metafile
pCurrXclObj = new XclObjAny( rRootData );
}
+ else if( nObjType == OBJ_CAPTION ) // #107540# ignore permanent note shapes
+ {
+ pCurrXclObj = NULL;
+ }
+#if EXC_INCL_EXP_OCX
+ else if( nObjType >= OBJ_FM_CONTROL )
+ {
+ pCurrXclObj = aOcxConverter.CreateObjRec( rShape );
+ if( !pCurrXclObj )
+ pCurrXclObj = new XclObjAny( rRootData ); // just a metafile
+ }
+#endif
+ else
+ pCurrXclObj = new XclObjAny( rRootData ); // just a metafile
}
if ( pCurrXclObj )
{
@@ -295,31 +312,42 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
void XclEscherEx::EndShape( UINT16 nShapeType, UINT32 nShapeID )
{
- if ( !nShapeID && pCurrXclObj )
- { // shape not written
- XclObj* p = (XclObj*) rRootData.pObjRecs->Last();
- DBG_ASSERT( p == pCurrXclObj, "XclEscherEx::EndShape: what object?" );
- if ( p == pCurrXclObj )
+ // own escher data created? -> never delete such objects
+ bool bOwnEscher = pCurrXclObj && pCurrXclObj->IsOwnEscher();
+
+ // post process the current object - not for objects with own escher data
+ if( pCurrXclObj && !bOwnEscher )
+ {
+ // escher data of last shape not written? -> delete it from object list
+ if( nShapeID == 0 )
{
- rRootData.pObjRecs->Remove();
- delete pCurrXclObj;
- pCurrXclObj = NULL;
+ XclObj* pLastObj = static_cast< XclObj* >( rRootData.pObjRecs->Last() );
+ DBG_ASSERT( pLastObj == pCurrXclObj, "XclEscherEx::EndShape - wrong object" );
+ if ( pLastObj == pCurrXclObj )
+ {
+ rRootData.pObjRecs->Remove();
+ DELETEZ( pCurrXclObj );
+ }
}
- }
- if ( pCurrXclObj )
- {
- if ( pCurrAppData->IsStackedGroup() )
- pCurrXclObj->SetEscherShapeTypeGroup();
- else
+
+ if( pCurrXclObj )
{
- pCurrXclObj->SetEscherShapeType( nShapeType );
- pCurrXclObj->UpdateStopPos();
+ // set shape type
+ if ( pCurrAppData->IsStackedGroup() )
+ pCurrXclObj->SetEscherShapeTypeGroup();
+ else
+ {
+ pCurrXclObj->SetEscherShapeType( nShapeType );
+ pCurrXclObj->UpdateStopPos();
+ }
}
}
+
+ // get next object from stack
DeleteCurrAppData();
- pCurrAppData = (XclEscherHostAppData*) aStack.Pop();
- pCurrXclObj = (XclObj*) aStack.Pop();
- if ( nAdditionalText == 3 )
+ pCurrAppData = static_cast< XclEscherHostAppData* >( aStack.Pop() );
+ pCurrXclObj = static_cast< XclObj* >( aStack.Pop() );
+ if( nAdditionalText == 3 )
nAdditionalText = 0;
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index a96dba9da87f..7360ffa8cafe 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xcl97rec.cxx,v $
*
- * $Revision: 1.50 $
+ * $Revision: 1.51 $
*
- * last change: $Author: jmarmion $ $Date: 2002-12-13 12:06:21 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,9 +93,12 @@
#ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet
#include
#endif
+#ifndef _SVX_UNOAPI_HXX_
+#include
+#endif
-#ifndef _TOOLS_SOLMATH_HXX // DoubleToString()
-#include
+#ifndef INCLUDED_RTL_MATH_HXX
+#include
#endif
#ifndef _ZFORMAT_HXX // SvNumberformat
#include
@@ -108,6 +111,9 @@
#include "xcl97esc.hxx"
#include "excupn.hxx"
+#ifndef SC_FAPIHELPER_HXX
+#include "fapihelper.hxx"
+#endif
#ifndef SC_XECONTENT_HXX
#include "xecontent.hxx"
#endif
@@ -145,6 +151,12 @@
#include "docoptio.hxx"
#include "patattr.hxx"
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::drawing::XShape;
+
+
//___________________________________________________________________
// --- class XclMsodrawing_Base --------------------------------------
@@ -377,14 +389,15 @@ void XclObjList::Save( XclExpStream& rStrm )
// --- class XclObj --------------------------------------------------
-XclObj::XclObj( ObjType eType, RootData& rRoot )
+XclObj::XclObj( ObjType eType, RootData& rRoot, bool bOwnEscher )
:
pClientTextbox( NULL ),
pTxo( NULL ),
eObjType( eType ),
nObjId(0),
nGrbit( 0x6011 ), // AutoLine, AutoFill, Printable, Locked
- bFirstOnSheet( rRoot.pObjRecs->Count() == 0 )
+ bFirstOnSheet( rRoot.pObjRecs->Count() == 0 ),
+ mbOwnEscher( bOwnEscher )
{
//! first object continues the first MSODRAWING record
if ( bFirstOnSheet )
@@ -493,9 +506,9 @@ ULONG XclObj::GetLen() const
// --- class XclObjComment -------------------------------------------
-XclObjComment::XclObjComment( RootData& rRoot, const ScAddress& rPos, const String& rStr )
+XclObjComment::XclObjComment( RootData& rRoot, const ScAddress& rPos, const String& rStr, bool bVisible )
:
- XclObj( otComment, rRoot )
+ XclObj( otComment, rRoot, true )
{
nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked
XclEscherEx* pEx = pMsodrawing->GetEscherEx();
@@ -510,7 +523,9 @@ XclObjComment::XclObjComment( RootData& rRoot, const ScAddress& rPos, const Stri
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 );
aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field
- aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x000A0002 ); // bool field
+ sal_uInt32 nFlags = 0x000A0000;
+ ::set_flag( nFlags, 2UL, !bVisible );
+ aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
aPropOpt.Commit( pEx->GetStream() );
XclEscherClientAnchor( rRoot.pDoc, rPos ).WriteData( *pEx );
@@ -576,7 +591,7 @@ ULONG XclObjComment::GetLen() const
// --- class XclObjDropDown ------------------------------------------
XclObjDropDown::XclObjDropDown( RootData& rRoot, const ScAddress& rPos, BOOL bFilt ) :
- XclObj( otComboBox, rRoot ),
+ XclObj( otComboBox, rRoot, true ),
bIsFiltered( bFilt )
{
SetLocked( TRUE );
@@ -875,6 +890,106 @@ ULONG XclObjOle::GetLen() const
}
+// ----------------------------------------------------------------------------
+
+#if EXC_INCL_EXP_OCX
+
+XclExpObjControl::XclExpObjControl(
+ const XclRoot& rRoot,
+ const Reference< XShape >& rxShape,
+ const String& rClassName,
+ sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
+ XclObj( otPicture, *rRoot.mpRD, true ),
+ maClassName( rClassName ),
+ mnStrmStart( nStrmStart ),
+ mnStrmSize( nStrmSize )
+{
+ SetAutoLine( FALSE );
+
+ XclEscherEx& rEscherEx = *pMsodrawing->GetEscherEx();
+ rEscherEx.OpenContainer( ESCHER_SpContainer );
+ rEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
+ Rectangle aDummyRect;
+ EscherPropertyContainer aPropOpt( rEscherEx, rEscherEx.QueryPicStream(), aDummyRect );
+ aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
+ aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
+ aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
+
+ Reference< XPropertySet > xShapePS( rxShape, UNO_QUERY );
+ if( xShapePS.is() )
+ {
+ // meta file
+ if( aPropOpt.CreateGraphicProperties( xShapePS, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ {
+ sal_uInt32 nBlipId;
+ if( aPropOpt.GetOpt( ESCHER_Prop_pib, nBlipId ) )
+ aPropOpt.AddOpt( ESCHER_Prop_pictureId, nBlipId );
+ }
+
+ // name of the control
+ ::rtl::OUString aCtrlName;
+ //! TODO - this does not work - property is empty
+ if( ::getPropValue( aCtrlName, xShapePS, PROPNAME( "Name" ) ) && aCtrlName.getLength() )
+ {
+ XclExpString aCtrlNameEx( aCtrlName, EXC_STR_FORCEUNICODE );
+ sal_uInt32 nBufferSize = aCtrlNameEx.GetBufferSize() + 2; // plus trailing zero
+ sal_uInt8* pBuffer = new sal_uInt8[ nBufferSize ];
+ aCtrlNameEx.WriteBuffer( pBuffer );
+ pBuffer[ nBufferSize - 2 ] = pBuffer[ nBufferSize - 1 ] = 0;
+ // aPropOpt takes ownership of pBuffer
+ aPropOpt.AddOpt( ESCHER_Prop_wzName, TRUE, nBufferSize, pBuffer, nBufferSize );
+ }
+ }
+
+ aPropOpt.Commit( rEscherEx.GetStream() );
+
+ if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( rxShape ) )
+ XclEscherClientAnchor( *rRoot.mpRD, *pSdrObj ).WriteData( rEscherEx );
+ rEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
+ rEscherEx.CloseContainer(); // ESCHER_SpContainer
+
+ pMsodrawing->UpdateStopPos();
+}
+
+void XclExpObjControl::SaveCont( XclExpStream& rStrm )
+{
+ // ftCmo
+ XclObj::SaveCont( rStrm );
+ // ftCf (clipboard format)
+ rStrm << sal_uInt16( ftCf ) << sal_uInt16( 2 ) << sal_uInt16( 2 );
+ // ftPioGrbit
+ rStrm << sal_uInt16( ftPioGrbit ) << sal_uInt16( 2 ) << sal_uInt16( 0x0031 );
+
+ // ftPictFmla
+ XclExpString aClass( maClassName );
+ sal_uInt16 nClassNameSize = static_cast< sal_uInt16 >( aClass.GetSize() );
+ sal_uInt16 nClassNamePad = nClassNameSize & 1;
+ sal_uInt16 nFirstPartSize = 12 + nClassNameSize + nClassNamePad;
+ sal_uInt16 nPictFmlaSize = nFirstPartSize + 18;
+
+ rStrm << sal_uInt16( ftPictFmla ) << sal_uInt16( nPictFmlaSize )
+ << sal_uInt16( nFirstPartSize ) // size of first part
+ << sal_uInt16( 5 ) // formula size
+ << sal_uInt32( 0 ) // unknown ID
+ << sal_uInt8( 0x02 ) << sal_uInt32( 0 ) // tTbl token with unknown ID
+ << sal_uInt8( 3 ) // pad to word
+ << aClass; // "Forms.***.1"
+ rStrm.WriteZeroBytes( nClassNamePad ); // pad to word
+ rStrm << mnStrmStart // start in 'Ctls' stream
+ << mnStrmSize // size in 'Ctls' stream
+ << sal_uInt32( 0 ) << sal_uInt32( 0 ); // unknown
+
+ // ftEnd
+ rStrm << sal_uInt16( ftEnd ) << sal_uInt16( 0 );
+}
+
+sal_uInt32 XclExpObjControl::GetLen() const
+{
+ return 0; // calculated by XclExpStream
+}
+
+#endif
+
// --- class XclObjAny -------------------------------------------
XclObjAny::XclObjAny( RootData& rRoot )
@@ -925,81 +1040,50 @@ ULONG XclObjAny::GetLen() const
-// --- class XclNoteList ----------------------------------------------
+// ----------------------------------------------------------------------------
-XclNoteList::XclNoteList()
+XclExpNote::XclExpNote(
+ const XclExpRoot& rRoot, const ScAddress& rPos,
+ const ScPostIt* pScNote, const String& rAddText ) :
+ XclExpRecord( EXC_ID_NOTE ),
+ maPos( rPos ),
+ mnObjId( 0 ),
+ mbVisible( pScNote && pScNote->IsShown() )
{
-}
-
+ String aNoteText;
-XclNoteList::~XclNoteList()
-{
- for ( XclNote* p = First(); p; p = Next() )
+ // read strings from note object, if present
+ if( pScNote )
{
- delete p;
+ aNoteText = pScNote->GetText();
+ maAuthor.Assign( pScNote->GetAuthor() );
}
-}
-
-
-void XclNoteList::Add( XclNote* pNote )
-{
- // limitation on 64kB is done in XclObjList,
- // more notes get no ID and will not save themselfs
- Insert( pNote, LIST_APPEND );
-}
-
-void XclNoteList::Save( XclExpStream& rStrm )
-{
- for ( XclNote* p = First(); p; p = Next() )
+ // append additional text
+ if( rAddText.Len() )
{
- p->Save( rStrm );
+ if( aNoteText.Len() )
+ aNoteText.Append( EXC_NEWLINE ).Append( EXC_NEWLINE );
+ aNoteText.Append( rAddText );
}
-}
+ // create the Escher object
+ mnObjId = rRoot.mpRD->pObjRecs->Add( new XclObjComment( *rRoot.mpRD, maPos, aNoteText, mbVisible ) );
-
-// --- class XclNote -------------------------------------------------
-
-XclNote::XclNote( RootData& rRoot, const ScAddress& rPos, const String& rNoteText, const String& rNoteAuthor ) :
- aAuthor( rNoteAuthor ),
- aPos( rPos ),
- nGrbit(0)
-{
- XclObjComment* pObj = new XclObjComment( rRoot, rPos, rNoteText );
- nObjId = rRoot.pObjRecs->Add( pObj );
+ SetRecSize( 9 + maAuthor.GetSize() );
}
-
-XclNote::~XclNote()
+void XclExpNote::Save( XclExpStream& rStrm )
{
+ if( mnObjId )
+ XclExpRecord::Save( rStrm );
}
-
-void XclNote::SaveCont( XclExpStream& rStrm )
+void XclExpNote::WriteBody( XclExpStream& rStrm )
{
- rStrm << (UINT16) aPos.Row() << (UINT16) aPos.Col() << nGrbit << nObjId
- << aAuthor
- << UINT8(0); // pad byte goes here (always)
-}
-
-
-void XclNote::Save( XclExpStream& rStrm )
-{
- if ( nObjId )
- ExcRecord::Save( rStrm );
-}
-
-
-UINT16 XclNote::GetNum() const
-{
- return 0x001C;
-}
-
-
-ULONG XclNote::GetLen() const
-{
- return nObjId ? 9 + aAuthor.GetSize() : 0;
+ sal_uInt16 nFlags = mbVisible ? EXC_NOTE_VISIBLE : 0;
+ rStrm << (sal_uInt16) maPos.Row() << (sal_uInt16) maPos.Col()
+ << nFlags << mnObjId << maAuthor << sal_uInt8( 0 );
}
@@ -1074,15 +1158,14 @@ ExcLabelSst::ExcLabelSst(
ExcLabelSst::ExcLabelSst(
const ScAddress& rPos,
const ScPatternAttr* pAttr,
- RootData& rRoot,
+ RootData& rRootData,
const ScEditCell& rEdCell ) :
- ExcCell( rPos, pAttr, rRoot )
+ ExcCell( rPos, pAttr, rRootData )
{
- XclExpString* pStr = XclExpStringHelper::CreateString( *rRoot.pER, rEdCell, pAttr );
- UsedAttrList& rXFBuffer = *rRoot.pXFRecs;
- const ScPatternAttr& rAttr = pAttr ? *pAttr : *rRoot.pER->GetDoc().GetDefPattern();
- SetXF( pStr->IsWrapped() ? rXFBuffer.FindWithLineBreak( &rAttr ) : rXFBuffer.Find( &rAttr ) );
- nIsst = rRoot.pER->GetSst().Insert( pStr );
+ const XclExpRoot& rRoot = *rRootData.pER;
+ XclExpString* pString = XclExpStringHelper::CreateString( rRoot, rEdCell, pAttr );
+ SetXF( rRoot.GetXFBuffer().Insert( pAttr, pString->IsWrapped() ) );
+ nIsst = rRoot.GetSst().Insert( pString );
}
@@ -1110,113 +1193,6 @@ ULONG ExcLabelSst::GetDiffLen() const
-// --- class ExcXf8 --------------------------------------------------
-
-ExcXf8::ExcXf8( const XclExpRoot& rRoot, UINT16 nFont, UINT16 nForm, const ScPatternAttr* pPattAttr,
- BOOL& rbLineBreak, BOOL bSt ) :
- ExcXf( rRoot, nFont, nForm, pPattAttr, rbLineBreak, bSt ),
- eTextDir( xlTextDirContext ),
- nTrot( 0 ),
- nCIndent( 0 ),
- bFShrinkToFit( FALSE ),
- bFMergeCell( FALSE ),
- nGrbitDiag( 0 ),
- nIcvDiagSer( 0 ),
- nDgDiag( 0 )
-{
- if( eOri == xlTextOrientTopBottom )
- nTrot = 0x00FF;
- else if( eOri != xlTextOrientNoRot ) // see #i4378
- nTrot = (eOri == xlTextOrient90ccw) ? 90 : 180;
- else if( pPattAttr )
- nTrot = XclTools::GetExcRotation( ((const SfxInt32Item&) pPattAttr->GetItem( ATTR_ROTATE_VALUE )).GetValue() );
-
- if( pPattAttr )
- {
- nCIndent = (UINT16)((const SfxUInt16Item&) pPattAttr->GetItem( ATTR_INDENT )).GetValue();
- nCIndent += 100;
- nCIndent /= 200;
- if( nCIndent > 15 )
- nCIndent = 15;
-
- switch( (SvxFrameDirection)((const SvxFrameDirectionItem&)pPattAttr->GetItem( ATTR_WRITINGDIR )).GetValue() )
- {
- case FRMDIR_ENVIRONMENT: eTextDir = xlTextDirContext; break;
- case FRMDIR_HORI_LEFT_TOP: eTextDir = xlTextDirLTR; break;
- case FRMDIR_HORI_RIGHT_TOP: eTextDir = xlTextDirRTL; break;
- default: DBG_ERRORFILE( "ExcXf8::ExcXf8 - unknown CTL text direction" );
- }
- }
-}
-
-
-void ExcXf8::SaveCont( XclExpStream& rStrm )
-{
- register UINT16 nTmp;
- register UINT32 nTmp32;
-
- rStrm << nIfnt << nIfmt // Offs 4 + 6
- << nOffs8; // Offs 8
-
- nTmp = ( UINT16 ) eAlc; // Offs 10
- if( bFWrap )
- nTmp |= 0x0008;
- nTmp |= ( ( UINT16 ) eAlcV ) << 4;
- nTmp |= nTrot << 8;
- rStrm << nTmp;
-
- nTmp = nCIndent; // Offs 12
- if( bFShrinkToFit )
- nTmp |= 0x0010;
- if( bFMergeCell )
- nTmp |= 0x0020;
- nTmp |= ((UINT16)eTextDir) << 6;
- // Bit 9-8 reserved, Bit 15-10 fAtr... alle 0 (keine Parent Styles)
- rStrm << nTmp;
-
- nTmp = nDgLeft; // Offs 14
- nTmp |= nDgRight << 4;
- nTmp |= nDgTop << 8;
- nTmp |= nDgBottom << 12;
- rStrm << nTmp;
-
- nTmp = GetPalette().GetColorIndex( nIcvLftSer ); // Offs 16
- nTmp |= GetPalette().GetColorIndex( nIcvRigSer ) << 7;
- nTmp |= nGrbitDiag << 14;
- rStrm << nTmp;
-
- nTmp32 = GetPalette().GetColorIndex( nIcvTopSer ); // Offs 18
- nTmp32 |= (UINT32) GetPalette().GetColorIndex( nIcvBotSer ) << 7;
- nTmp32 |= (UINT32) GetPalette().GetColorIndex( nIcvDiagSer ) << 14;
- nTmp32 |= (UINT32) nDgDiag << 21;
-
- UINT16 nForeInd, nBackInd;
- GetPalette().GetMixedColors( nForeInd, nBackInd, nFls, nIcvForeSer, nIcvBackSer );
-
- nTmp32 |= (UINT32) nFls << 26;
- rStrm << nTmp32;
-
- nTmp = nForeInd | (nBackInd << 7); // Offs 22
-
- if( bFSxButton )
- nTmp |= 0x4000;
- rStrm << nTmp;
-}
-
-
-UINT16 ExcXf8::GetNum() const
-{
- return 0x00E0;
-}
-
-
-ULONG ExcXf8::GetLen() const
-{
- return 20;
-}
-
-
-
// --- class ExcBundlesheet8 -----------------------------------------
ExcBundlesheet8::ExcBundlesheet8( RootData& rRootData, UINT16 nTab ) :
@@ -1422,25 +1398,24 @@ XclCondFormat::XclCondFormat( const ScConditionalFormat& _rCF, ScRangeList* _pRL
{
pCFE = _rCF.GetEntry( n );
if( pCFE )
- List::Insert( new XclCf( *rER.pER, *pCFE ), LIST_APPEND );
+ Append( new XclCf( *rER.pER, *pCFE ) );
}
}
XclCondFormat::~XclCondFormat()
{
- if( pRL )
- delete pRL;
+ delete pRL;
}
void XclCondFormat::WriteCondfmt( XclExpStream& rStrm )
{
- DBG_ASSERT( List::Count() < 65536, "XclCondFormat::SaveCont - to much CFs!" );
+ DBG_ASSERT( Count() < 65536, "XclCondFormat::SaveCont - to much CFs!" );
rStrm.StartRecord( 0x01B0, 0 ); // real size calculated by XclExpStream
- rStrm << (UINT16) List::Count() << (UINT16) 0x0000;
+ rStrm << (UINT16) Count() << (UINT16) 0x0001;
ULONG nMinMaxPos = rStrm.GetStreamPos();
UINT16 nRowFirst = 0xFFFF;
@@ -1491,7 +1466,7 @@ void XclCondFormat::Save( XclExpStream& rStrm )
WriteCondfmt( rStrm );
// write list of CF records
- for( XclCf* pCf = _First(); pCf; pCf = _Next() )
+ for( XclCf* pCf = First(); pCf; pCf = Next() )
pCf->Save( rStrm );
}
@@ -1596,28 +1571,11 @@ XclCf::XclCf( const XclExpRoot& rRoot, const ScCondFormatEntry& r ) :
// border data
if( bHasLine )
- {
- const SvxBoxItem& rBox = ((const SvxBoxItem&)aAttr.GetItem( ATTR_BORDER ));
- UINT16 nDgTop, nDgBottom, nDgLeft, nDgRight;
-
- ExcXf::ScToExcBorderLine( rPal, rBox.GetTop(), nIcvTopSer, nDgTop );
- ExcXf::ScToExcBorderLine( rPal, rBox.GetBottom(), nIcvBotSer, nDgBottom );
- ExcXf::ScToExcBorderLine( rPal, rBox.GetLeft(), nIcvLftSer, nDgLeft );
- ExcXf::ScToExcBorderLine( rPal, rBox.GetRight(), nIcvRigSer, nDgRight );
-
- nLineData1 = (UINT8)((nDgLeft & 0x0F) | (nDgRight << 4));
- nLineData2 = (UINT8)((nDgTop & 0x0F) | (nDgBottom << 4));
- }
+ XclExpXF::GetBorder( maBorder, rPal, aAttr );
// background / foreground data
if( bHasPattern )
- {
- const SvxBrushItem& rBrushItem = (const SvxBrushItem&)aAttr.GetItem( ATTR_BACKGROUND );
- Color aColor( rBrushItem.GetColor() );
- nPatt = aColor.GetTransparency() ? 0x0000 : 0x0001;
- nIcvForeSer = rPal.InsertColor( aColor, xlColorCellArea );
- nIcvBackSer = rPal.InsertColor( Color( COL_BLACK ), xlColorCellArea );
- }
+ XclExpXF::GetArea( maArea, rPal, aAttr );
}
ScTokenArray* pScTokArry1 = r.CreateTokenArry( 0 );
@@ -1699,22 +1657,26 @@ void XclCf::SaveCont( XclExpStream& rStrm )
}
if( bHasLine )
{
- UINT16 nLineData3, nLineData4;
- nLineData3 = rPal.GetColorIndex( nIcvLftSer ) & 0x007F;
- nLineData3 |= (rPal.GetColorIndex( nIcvRigSer ) & 0x007F) << 7;
- nLineData4 = rPal.GetColorIndex( nIcvTopSer ) & 0x007F;
- nLineData4 |= (rPal.GetColorIndex( nIcvBotSer ) & 0x007F) << 7;
+ sal_uInt8 nLineData1, nLineData2;
+ sal_uInt16 nLineData3, nLineData4;
+ nLineData1 = (UINT8)((maBorder.mnLeftLine & 0x0F) | (maBorder.mnRightLine << 4));
+ nLineData2 = (UINT8)((maBorder.mnTopLine & 0x0F) | (maBorder.mnBottomLine << 4));
+ nLineData3 = rPal.GetColorIndex( maBorder.mnLeftColorId ) & 0x007F;
+ nLineData3 |= (rPal.GetColorIndex( maBorder.mnRightColorId ) & 0x007F) << 7;
+ nLineData4 = rPal.GetColorIndex( maBorder.mnTopColorId ) & 0x007F;
+ nLineData4 |= (rPal.GetColorIndex( maBorder.mnBottomColorId ) & 0x007F) << 7;
rStrm << nLineData1 << nLineData2 << nLineData3 << nLineData4
<< (UINT16)0xBA00;
}
if( bHasPattern )
{
- UINT16 nForeInd, nBackInd;
- rPal.GetMixedColors( nForeInd, nBackInd, nPatt, nIcvForeSer, nIcvBackSer );
+ sal_uInt16 nXclForeIx, nXclBackIx;
+ sal_uInt8 nPattern = maArea.mnPattern;
+ rPal.GetMixedColors( nXclForeIx, nXclBackIx, nPattern, maArea.mnForeColorId, maArea.mnBackColorId );
- UINT8 nPattData1 = (nPatt == 1) ? 0 : (UINT8) nPatt;
- UINT16 nPattData2 = ((nForeInd & 0x007F ) << 7) | (nBackInd & 0x007F);
+ UINT8 nPattData1 = (nPattern == EXC_PATT_SOLID) ? 0 : nPattern;
+ UINT16 nPattData2 = ((nXclForeIx & 0x007F ) << 7) | (nXclBackIx & 0x007F);
rStrm << (UINT8)0 << nPattData1 << nPattData2;
}
@@ -1939,9 +1901,11 @@ ExcEScenario::ExcEScenario( ScDocument& rDoc, UINT16 nTab )
if( rDoc.HasValueData( nCol, nRow, nTab ) )
{
rDoc.GetValue( nCol, nRow, nTab, fVal );
- sText.Erase();
- SolarMath::DoubleToString( sText, fVal, 'A', INT_MAX,
- ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0), TRUE );
+ sText = ::rtl::math::doubleToUString( fVal,
+ rtl_math_StringFormat_Automatic,
+ rtl_math_DecimalPlaces_Max,
+ ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0),
+ TRUE );
}
else
rDoc.GetString( nCol, nRow, nTab, sText );
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index fed7ad2e9d8d..bdc878816632 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLChangeTrackingImportHelper.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: er $ $Date: 2002-04-15 11:04:14 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -900,6 +900,9 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc)
if (aProtect.getLength())
pTrack->SetProtection(aProtect);
+ if ( pTrack->GetLast() )
+ pTrack->SetLastSavedActionNumber(pTrack->GetLast()->GetActionNumber());
+
pDoc->SetChangeTrack(pTrack);
}
}
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx
index 90665dc11f4a..79f4c9f02cf2 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLConverter.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: sab $ $Date: 2001-11-15 11:36:12 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -725,7 +725,8 @@ void ScXMLConverter::ParseFormula(OUString& sFormula, const sal_Bool bIsFormula)
sal_Unicode chPrevious('=');
for (sal_Int32 i = 0; i < sFormula.getLength(); i++)
{
- if (sFormula[i] == '\'' && !bInDoubleQuotationMarks)
+ if (sFormula[i] == '\'' && !bInDoubleQuotationMarks &&
+ chPrevious != '\\')
bInQuotationMarks = !bInQuotationMarks;
else if (sFormula[i] == '"' && !bInQuotationMarks)
bInDoubleQuotationMarks = !bInDoubleQuotationMarks;
@@ -741,6 +742,8 @@ void ScXMLConverter::ParseFormula(OUString& sFormula, const sal_Bool bIsFormula)
sBuffer.append(sFormula[i]);
chPrevious = sFormula[i];
}
+
+ DBG_ASSERT(nCountBraces == 0, "there are some braces still open");
sFormula = sBuffer.makeStringAndClear();
}
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index b58baf734d61..55f669dad3d4 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLStylesExportHelper.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: hr $ $Date: 2002-02-08 18:28:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 263d2570c203..6880b9ecf831 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLStylesExportHelper.hxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: hr $ $Date: 2002-02-08 18:28:50 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index e82b0a865193..526e81bad44d 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLTableMasterPageExport.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: sab $ $Date: 2003-03-10 11:15:27 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,7 +136,7 @@ void XMLTableMasterPageExport::exportHeaderFooter(const com::sun::star::uno::Ref
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE );
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- aName, sal_True, sal_True );
+ aName, sal_True, sal_True );
if (sCenter.getLength() && !sLeft.getLength() && !sRight.getLength())
exportHeaderFooterContent( xCenter, sal_False, sal_False );
else
@@ -145,19 +145,19 @@ void XMLTableMasterPageExport::exportHeaderFooter(const com::sun::star::uno::Ref
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_LEFT, sal_True, sal_True );
- exportHeaderFooterContent( xLeft, sal_False, sal_False );
+ exportHeaderFooterContent( xLeft, sal_False, sal_False );
}
if (sCenter.getLength())
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_CENTER, sal_True, sal_True );
- exportHeaderFooterContent( xCenter, sal_False, sal_False );
+ exportHeaderFooterContent( xCenter, sal_False, sal_False );
}
if (sRight.getLength())
{
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
XML_REGION_RIGHT, sal_True, sal_True );
- exportHeaderFooterContent( xRight, sal_False, sal_False );
+ exportHeaderFooterContent( xRight, sal_False, sal_False );
}
}
}
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index b637947495b3..293005ea7a6b 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlcelli.cxx,v $
*
- * $Revision: 1.70 $
+ * $Revision: 1.71 $
*
- * last change: $Author: sab $ $Date: 2002-09-26 12:08:41 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -164,9 +164,6 @@
#ifndef _DATE_HXX
#include
#endif
-#ifndef _TOOLS_SOLMATH_HXX
-#include
-#endif
#ifndef _ISOLANG_HXX
#include
#endif
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index 51deb74f5775..3464c4a07d6c 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldrani.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: sab $ $Date: 2002-03-22 16:02:47 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -470,14 +470,14 @@ void ScXMLDatabaseRangeContext::EndElement()
xFilterPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_USEREGEX)), aTemp);
aTemp <<= aFilterOutputPosition;
xFilterPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_OUTPOS)), aTemp);
- if (bFilterConditionSourceRange)
- {
- ScRange aAdvSource;
- ScUnoConversion::FillScRange( aAdvSource, aFilterConditionSourceRangeAddress );
- pDBData->SetAdvancedQuerySource(&aAdvSource);
- }
}
xSheetFilterDescriptor->setFilterFields(aFilterFields);
+ if (bFilterConditionSourceRange)
+ {
+ ScRange aAdvSource;
+ ScUnoConversion::FillScRange( aAdvSource, aFilterConditionSourceRangeAddress );
+ pDBData->SetAdvancedQuerySource(&aAdvSource);
+ }
}
if (bContainsSubTotal)
{
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 3dc869871fc1..bea415afc45a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexprt.cxx,v $
*
- * $Revision: 1.164 $
+ * $Revision: 1.165 $
*
- * last change: $Author: sab $ $Date: 2002-12-06 05:59:14 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -185,8 +185,8 @@
#ifndef _TOOLS_DEBUG_HXX
#include
#endif
-#ifndef _TOOLS_SOLMATH_HXX
-#include
+#ifndef INCLUDED_RTL_MATH_HXX
+#include
#endif
#ifndef _ZFORLIST_HXX
#include
@@ -509,6 +509,21 @@ ScXMLExport::ScXMLExport(const sal_uInt16 nExportFlag) :
xRowStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX)));
GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME)),
xTableStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX)));
+
+ if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
+ {
+ sAttrName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_NAME));
+ sAttrStyleName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_STYLE_NAME));
+ sAttrColumnsRepeated = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_NUMBER_COLUMNS_REPEATED));
+ sAttrFormula = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_FORMULA));
+ sAttrStringValue = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_STRING_VALUE));
+ sElemCell = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_CELL));
+ sElemCoveredCell = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_COVERED_TABLE_CELL));
+ sElemCol = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_COLUMN));
+ sElemRow = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_ROW));
+ sElemTab = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE));
+ sElemP = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, GetXMLToken(XML_P));
+ }
}
@@ -840,17 +855,17 @@ void ScXMLExport::WriteSingleColumn(const sal_Int32 nRepeatColumns, const sal_In
const sal_Int32 nIndex, const sal_Bool bIsAutoStyle, const sal_Bool bIsVisible)
{
CheckAttrList();
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, *pColumnStyles->GetStyleNameByIndex(nStyleIndex));
+ AddAttribute(sAttrStyleName, *pColumnStyles->GetStyleNameByIndex(nStyleIndex));
if (!bIsVisible)
AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_COLLAPSE);
if (nRepeatColumns > 1)
{
OUString sOUEndCol = OUString::valueOf(static_cast (nRepeatColumns));
- AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, sOUEndCol);
+ AddAttribute(sAttrColumnsRepeated, sOUEndCol);
}
if (nIndex != -1)
AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, *pCellStyles->GetStyleNameByIndex(nIndex, bIsAutoStyle));
- SvXMLElementExport aElemR(*this, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True);
+ SvXMLElementExport aElemC(*this, sElemCol, sal_True, sal_True);
}
void ScXMLExport::WriteColumn(const sal_Int32 nColumn, const sal_Int32 nRepeatColumns,
@@ -1023,16 +1038,16 @@ void ScXMLExport::WriteRowContent()
else
{
if (nIndex != -1)
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, *pCellStyles->GetStyleNameByIndex(nIndex, bIsAutoStyle));
+ AddAttribute(sAttrStyleName, *pCellStyles->GetStyleNameByIndex(nIndex, bIsAutoStyle));
if (nPrevValidationIndex > -1)
AddAttribute(XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, pValidationsContainer->GetValidationName(nPrevValidationIndex));
if (nCols > 1)
{
rtl::OUStringBuffer aBuf;
GetMM100UnitConverter().convertNumber(aBuf, nCols);
- AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear());
+ AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear());
}
- SvXMLElementExport aElemC(*this, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
+ SvXMLElementExport aElemC(*this, sElemCell, sal_True, sal_True);
nIndex = aRange.nIndex;
bIsAutoStyle = aRange.bIsAutoStyle;
nCols = aRange.nRepeatColumns;
@@ -1047,23 +1062,23 @@ void ScXMLExport::WriteRowContent()
{
table::CellAddress aCellAddress;
if (nIndex != -1)
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, *pCellStyles->GetStyleNameByIndex(nIndex, bIsAutoStyle));
+ AddAttribute(sAttrStyleName, *pCellStyles->GetStyleNameByIndex(nIndex, bIsAutoStyle));
if (nPrevValidationIndex > -1)
AddAttribute(XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, pValidationsContainer->GetValidationName(nPrevValidationIndex));
if (nCols > 1)
{
rtl::OUStringBuffer aBuf;
GetMM100UnitConverter().convertNumber(aBuf, nCols);
- AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, aBuf.makeStringAndClear());
+ AddAttribute(sAttrColumnsRepeated, aBuf.makeStringAndClear());
}
- SvXMLElementExport aElemC(*this, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
+ SvXMLElementExport aElemC(*this, sElemCell, sal_True, sal_True);
}
}
void ScXMLExport::WriteRowStartTag(const sal_Int32 nRow, const sal_Int32 nIndex,
const sal_Int8 nFlag, const sal_Int32 nEqualRows)
{
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, *pRowStyles->GetStyleNameByIndex(nIndex));
+ AddAttribute(sAttrStyleName, *pRowStyles->GetStyleNameByIndex(nIndex));
if (nFlag)
if (nFlag & CR_HIDDEN)
{
@@ -1083,7 +1098,7 @@ void ScXMLExport::WriteRowStartTag(const sal_Int32 nRow, const sal_Int32 nIndex,
AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME,
*pCellStyles->GetStyleNameByIndex(nCellStyleIndex,
(*pDefaults->GetRowDefaults())[nRow].bIsAutoStyle));
- StartElement( XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True);
+ StartElement( sElemRow, sal_True);
}
void ScXMLExport::OpenHeaderRows()
@@ -1200,7 +1215,7 @@ void ScXMLExport::CloseRow(const sal_Int32 nRow)
{
if (nOpenRow > -1)
{
- EndElement(XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True);
+ EndElement(sElemRow, sal_True);
if (bHasRowHeader && nRow == aRowHeaderRange.EndRow)
{
CloseHeaderRows();
@@ -1430,8 +1445,8 @@ void ScXMLExport::_ExportContent()
{
nCurrentTable = nTable;
rtl::OUString sOUTableName = xName->getName();
- AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, sOUTableName);
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, aTableStyles[nTable]);
+ AddAttribute(sAttrName, sOUTableName);
+ AddAttribute(sAttrStyleName, aTableStyles[nTable]);
uno::Reference xProtectable (xTable, uno::UNO_QUERY);
if (xProtectable.is())
if (xProtectable->isProtected())
@@ -1446,7 +1461,7 @@ void ScXMLExport::_ExportContent()
rtl::OUString sPrintRanges( GetPrintRanges() );
if( sPrintRanges.getLength() )
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT_RANGES, sPrintRanges );
- SvXMLElementExport aElemT(*this, XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True);
+ SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True);
CheckAttrList();
WriteTableSource();
WriteScenario();
@@ -2242,7 +2257,7 @@ OUString ScXMLExport::GetPrintRanges()
void ScXMLExport::WriteCell (ScMyCell& aCell)
{
if (aCell.nStyleIndex != -1)
- AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, *pCellStyles->GetStyleNameByIndex(aCell.nStyleIndex, aCell.bIsAutoStyle));
+ AddAttribute(sAttrStyleName, *pCellStyles->GetStyleNameByIndex(aCell.nStyleIndex, aCell.bIsAutoStyle));
if (aCell.nValidationIndex > -1)
AddAttribute(XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME, pValidationsContainer->GetValidationName(aCell.nValidationIndex));
sal_Bool bIsMatrix(aCell.bIsMatrixBase || aCell.bIsMatrixCovered);
@@ -2274,7 +2289,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
aCell.bHasDoubleValue = sal_True;
}
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
- aCell.nNumberFormat, aCell.fValue, XML_NAMESPACE_TABLE);
+ aCell.nNumberFormat, aCell.fValue);
}
break;
case table::CellContentType_TEXT :
@@ -2285,7 +2300,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
if (sFormula[0] == '\'')
sFormula = sFormula.copy(1);
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
- sFormula, aCell.sStringValue, XML_NAMESPACE_TABLE, sal_True, sal_False);
+ sFormula, aCell.sStringValue, sal_True, sal_False);
}
}
break;
@@ -2304,11 +2319,11 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
pFormulaCell->GetEnglishFormula(sFormula, sal_True);
rtl::OUString sOUFormula(sFormula.makeStringAndClear());
if (!bIsMatrix)
- AddAttribute(XML_NAMESPACE_TABLE, XML_FORMULA, sOUFormula);
+ AddAttribute(sAttrFormula, sOUFormula);
else
{
rtl::OUString sMatrixFormula = sOUFormula.copy(1, sOUFormula.getLength() - 2);
- AddAttribute(XML_NAMESPACE_TABLE, XML_FORMULA, sMatrixFormula);
+ AddAttribute(sAttrFormula, sMatrixFormula);
}
}
if (pFormulaCell->IsValue())
@@ -2321,28 +2336,29 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
if (pDoc)
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
pFormulaCell->GetStandardFormat(*pDoc->GetFormatTable(), 0),
- aCell.xCell->getValue(), XML_NAMESPACE_TABLE);
+ aCell.xCell->getValue());
}
else
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
- aCell.nNumberFormat, aCell.xCell->getValue(), XML_NAMESPACE_TABLE);
+ aCell.nNumberFormat, aCell.xCell->getValue());
}
else
{
if (GetCellText(aCell))
if (aCell.sStringValue.getLength())
- AddAttribute(XML_NAMESPACE_TABLE, XML_STRING_VALUE, aCell.sStringValue);
+ AddAttribute(sAttrStringValue, aCell.sStringValue);
}
}
}
break;
}
- XMLTokenEnum nCellType;
+ rtl::OUString* pCellString = &sElemCell;
if (aCell.bIsCovered)
- nCellType = XML_COVERED_TABLE_CELL;
+ {
+ pCellString = &sElemCoveredCell;
+ }
else
{
- nCellType = XML_TABLE_CELL;
if (aCell.bIsMergedBase)
{
sal_Int32 nColumns = aCell.aMergeRange.EndColumn - aCell.aMergeRange.StartColumn + 1;
@@ -2355,7 +2371,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_SPANNED, sRows.makeStringAndClear());
}
}
- SvXMLElementExport aElemC(*this, XML_NAMESPACE_TABLE, nCellType, sal_True, sal_True);
+ SvXMLElementExport aElemC(*this, *pCellString, sal_True, sal_True);
CheckAttrList();
WriteAreaLink(aCell);
WriteAnnotation(aCell);
@@ -2374,7 +2390,7 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
}
else
{
- SvXMLElementExport aElemC(*this, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemC(*this, sElemP, sal_True, sal_False);
sal_Bool bPrevCharWasSpace(sal_True);
if (GetCellText(aCell))
GetTextParagraphExport()->exportText(aCell.sStringValue, bPrevCharWasSpace);
@@ -2585,7 +2601,7 @@ void ScXMLExport::WriteAnnotation(const ScMyCell& rMyCell)
{
if (sOUText2[i] == '\n')
{
- SvXMLElementExport aElemP(*this, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(*this, sElemP, sal_True, sal_False);
GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace);
}
else
@@ -2594,7 +2610,7 @@ void ScXMLExport::WriteAnnotation(const ScMyCell& rMyCell)
}
if (sTemp.getLength())
{
- SvXMLElementExport aElemP(*this, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
+ SvXMLElementExport aElemP(*this, sElemP, sal_True, sal_False);
GetTextParagraphExport()->exportText(sTemp.makeStringAndClear(), bPrevCharWasSpace);
}
CheckAttrList();
@@ -2651,7 +2667,7 @@ void ScXMLExport::SetRepeatAttribute (const sal_Int32 nEqualCellCount)
{
sal_Int32 nTemp = nEqualCellCount + 1;
OUString sOUEqualCellCount = OUString::valueOf(nTemp);
- AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, sOUEqualCellCount);
+ AddAttribute(sAttrColumnsRepeated, sOUEqualCellCount);
GetProgressBarHelper()->Increment(nEqualCellCount);
}
}
@@ -2831,7 +2847,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference >= aNullDate;
if (bCalcAsShown || bIgnoreCase || !bLookUpLabels || !bMatchWholeCell || !bUseRegularExpressions ||
- bIsIterationEnabled || nIterationCount != 100 || !SolarMath::ApproxEqual(fIterationEpsilon, 0.001) ||
+ bIsIterationEnabled || nIterationCount != 100 || !::rtl::math::approxEqual(fIterationEpsilon, 0.001) ||
aNullDate.Day != 30 || aNullDate.Month != 12 || aNullDate.Year != 1899 || nYear2000 != 1930)
{
if (bIgnoreCase)
@@ -2859,7 +2875,7 @@ void ScXMLExport::WriteCalculationSettings(const uno::Reference getName();
- AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, sOUName);
+ AddAttribute(sAttrName, sOUName);
OUString sOUBaseCellAddress;
ScXMLConverter::GetStringFromAddress( sOUBaseCellAddress,
@@ -3286,10 +3302,7 @@ void ScXMLExport::CreateSharedData(const sal_Int32 nTableCount)
XMLNumberFormatAttributesExportHelper* ScXMLExport::GetNumberFormatAttributesExportHelper()
{
if (!pNumberFormatAttributesExportHelper)
- {
- pNumberFormatAttributesExportHelper = new XMLNumberFormatAttributesExportHelper(GetNumberFormatsSupplier());
- pNumberFormatAttributesExportHelper->SetExport(this);
- }
+ pNumberFormatAttributesExportHelper = new XMLNumberFormatAttributesExportHelper(GetNumberFormatsSupplier(), *this, XML_NAMESPACE_TABLE);
return pNumberFormatAttributesExportHelper;
}
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index 59b0c16378fc..aa3a1ffcbe60 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexprt.hxx,v $
*
- * $Revision: 1.72 $
+ * $Revision: 1.73 $
*
- * last change: $Author: sab $ $Date: 2001-10-19 09:17:59 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -139,6 +139,17 @@ class ScXMLExport : public SvXMLExport
ScChangeTrackingExportHelper* pChangeTrackingExportHelper;
const rtl::OUString sLayerID;
const rtl::OUString sCaptionShape;
+ rtl::OUString sAttrName;
+ rtl::OUString sAttrStyleName;
+ rtl::OUString sAttrColumnsRepeated;
+ rtl::OUString sAttrFormula;
+ rtl::OUString sAttrStringValue;
+ rtl::OUString sElemCell;
+ rtl::OUString sElemCoveredCell;
+ rtl::OUString sElemCol;
+ rtl::OUString sElemRow;
+ rtl::OUString sElemTab;
+ rtl::OUString sElemP;
sal_Int32 nOpenRow;
sal_uInt16 nCurrentTable;
sal_Bool bHasRowHeader : 1;
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index e97b614261b5..077944507e3c 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlwrap.cxx,v $
*
- * $Revision: 1.48 $
+ * $Revision: 1.49 $
*
- * last change: $Author: sab $ $Date: 2002-09-26 12:08:42 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,6 +118,9 @@
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_PACKAGES_ZIP_ZIPIOEXCEPTION_HPP_
+#include
+#endif
#ifndef _XMLEOHLP_HXX
#include
@@ -358,6 +361,15 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::ReferenceAddAccessibilityObject(*this);
}
ScAccessibleCell::~ScAccessibleCell()
@@ -174,6 +176,13 @@ void SAL_CALL ScAccessibleCell::disposing()
// #100593# dispose in AccessibleStaticTextBase
Dispose();
+ if (mpViewShell)
+ {
+ mpViewShell->RemoveAccessibilityObject(*this);
+ mpViewShell = NULL;
+ }
+ mpAccDoc = NULL;
+
ScAccessibleCellBase::disposing();
}
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index 2ff503aabfa4..510d0b678510 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleContextBase.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: sab $ $Date: 2002-12-04 15:39:54 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -111,6 +111,9 @@
#ifndef _TOOLS_COLOR_HXX
#include
#endif
+#ifndef COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+#include
+#endif
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -127,7 +130,7 @@ ScAccessibleContextBase::ScAccessibleContextBase(
ScAccessibleContextBaseWeakImpl(m_aMutex),
maRole(aRole),
mxParent(rxParent),
- mpEventListeners(NULL)
+ mnClientId(0)
{
DBG_CTOR(ScAccessibleContextBase, NULL);
}
@@ -169,15 +172,11 @@ void SAL_CALL ScAccessibleContextBase::disposing()
// hold reference to make sure that the destructor is not called
uno::Reference< XAccessibleContext > xOwnContext(this);
- if (mpEventListeners)
+ if ( mnClientId )
{
- lang::EventObject aEvent;
- aEvent.Source = static_cast(this);
- if (mpEventListeners)
- {
- mpEventListeners->disposeAndClear(aEvent);
- DELETEZ( mpEventListeners );
- }
+ sal_Int32 nTemClientId(mnClientId);
+ mnClientId = 0;
+ comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nTemClientId, *this );
}
if (mxParent.is())
@@ -496,9 +495,9 @@ void SAL_CALL
IsObjectValid();
if (!IsDefunc())
{
- if (!mpEventListeners)
- mpEventListeners = new cppu::OInterfaceContainerHelper(m_aMutex);
- mpEventListeners->addInterface(xListener);
+ if (!mnClientId)
+ mnClientId = comphelper::AccessibleEventNotifier::registerClient( );
+ comphelper::AccessibleEventNotifier::addEventListener( mnClientId, xListener );
}
}
}
@@ -511,8 +510,19 @@ void SAL_CALL
if (xListener.is())
{
ScUnoGuard aGuard;
- if (!IsDefunc() && mpEventListeners)
- mpEventListeners->removeInterface(xListener);
+ if (!IsDefunc() && mnClientId)
+ {
+ sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, xListener );
+ if ( !nListenerCount )
+ {
+ // no listeners anymore
+ // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
+ // and at least to us not firing any events anymore, in case somebody calls
+ // NotifyAccessibleEvent, again
+ comphelper::AccessibleEventNotifier::revokeClient( mnClientId );
+ mnClientId = 0;
+ }
+ }
}
}
@@ -616,38 +626,8 @@ uno::Sequence SAL_CALL
void ScAccessibleContextBase::CommitChange(const AccessibleEventObject& rEvent) const
{
- if (mpEventListeners)
- {
- // Call all listeners.
- uno::Sequence< uno::Reference< uno::XInterface > > aListeners = mpEventListeners->getElements();
- sal_uInt32 nLength(aListeners.getLength());
- if (nLength)
- {
- const uno::Reference< uno::XInterface >* pInterfaces = aListeners.getConstArray();
- if (pInterfaces)
- {
- sal_uInt32 i(0);
- while (i < nLength)
- {
- try
- {
- while(i < nLength)
- {
- static_cast< XAccessibleEventListener* >(pInterfaces->get())->notifyEvent(rEvent);
- ++pInterfaces;
- ++i;
- }
- }
- catch(uno::RuntimeException&)
- {
-// DBG_ERROR("a object is gone without to remove from Broadcaster");
- ++pInterfaces;
- ++i;
- }
- }
- }
- }
- }
+ if (mnClientId)
+ comphelper::AccessibleEventNotifier::addEvent( mnClientId, rEvent );
}
void ScAccessibleContextBase::ChangeName()
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index f4b12ebc39e0..f2fdda6775c2 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleCsvControl.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: sab $ $Date: 2002-11-15 09:34:12 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -146,8 +146,8 @@
#ifndef SC_SCMOD_HXX
#include "scmod.hxx"
#endif
-#ifndef _SVX_COLORCFG_HXX
-#include
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include
#endif
using ::rtl::OUString;
@@ -615,8 +615,8 @@ sal_Int32 SAL_CALL ScAccessibleCsvRuler::getIndexAtPoint( const AwtPoint& rPoint
ScUnoGuard aGuard;
ensureAlive();
ScCsvRuler& rRuler = implGetRuler();
- Point aPos( implGetRelPos( VCLPoint( rPoint ) ) );
- return ::std::min( ::std::max( rRuler.GetPosFromX( aPos.X() ), 0L ), rRuler.GetPosCount() );
+ // #107054# use object's coordinate system
+ return ::std::min( ::std::max( rRuler.GetPosFromX( rPoint.X ), 0L ), rRuler.GetPosCount() );
}
OUString SAL_CALL ScAccessibleCsvRuler::getSelectedText() throw( RuntimeException )
@@ -1002,9 +1002,11 @@ Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleAt( const Aw
ensureAlive();
const ScCsvGrid& rGrid = implGetGrid();
- // #102679#; use >= instead of >, because the offset is the size and not the point
- sal_Int32 nColumn = (rPoint.X >= rGrid.GetOffsetX()) ? lcl_GetApiColumn( rGrid.GetColumnFromX( rPoint.X ) ) : 0;
- sal_Int32 nRow = (rPoint.Y >= rGrid.GetOffsetY()) ? (rGrid.GetLineFromY( rPoint.Y ) - rGrid.GetFirstVisLine() + 1) : 0;
+ // #102679#; use <= instead of <, because the offset is the size and not the point
+ sal_Int32 nColumn = ((rGrid.GetFirstX() <= rPoint.X) && (rPoint.X <= rGrid.GetLastX())) ?
+ lcl_GetApiColumn( rGrid.GetColumnFromX( rPoint.X ) ) : 0;
+ sal_Int32 nRow = (rPoint.Y >= rGrid.GetHdrHeight()) ?
+ (rGrid.GetLineFromY( rPoint.Y ) - rGrid.GetFirstVisLine() + 1) : 0;
xRet = implCreateCellObj( nRow, nColumn );
}
return xRet;
@@ -1023,7 +1025,7 @@ throw (RuntimeException)
{
ScUnoGuard aGuard;
ensureAlive();
- return SC_MOD()->GetColorConfig().GetColorValue( ::svx::DOCCOLOR ).nColor;
+ return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
// XAccessibleContext ---------------------------------------------------------
@@ -1571,7 +1573,7 @@ throw (RuntimeException)
{
ScUnoGuard aGuard;
ensureAlive();
- return SC_MOD()->GetColorConfig().GetColorValue( ::svx::DOCCOLOR ).nColor;
+ return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
// XAccessibleContext -----------------------------------------------------
@@ -1707,7 +1709,7 @@ Point ScAccessibleCsvCell::implGetRealPos() const
{
ScCsvGrid& rGrid = implGetGrid();
return Point(
- (mnColumn == CSV_COLUMN_HEADER) ? 0 : rGrid.GetColumnX( mnColumn ),
+ (mnColumn == CSV_COLUMN_HEADER) ? rGrid.GetHdrX() : rGrid.GetColumnX( mnColumn ),
(mnLine == CSV_LINE_HEADER) ? 0 : rGrid.GetY( mnLine ) );
}
@@ -1721,8 +1723,8 @@ Size ScAccessibleCsvCell::implGetRealSize() const
{
ScCsvGrid& rGrid = implGetGrid();
return Size(
- (mnColumn == CSV_COLUMN_HEADER) ? rGrid.GetOffsetX() : implCalcPixelWidth(rGrid.GetColumnWidth( mnColumn )),
- (mnLine == CSV_LINE_HEADER) ? rGrid.GetOffsetY() : rGrid.GetLineHeight() );
+ (mnColumn == CSV_COLUMN_HEADER) ? rGrid.GetHdrWidth() : implCalcPixelWidth( rGrid.GetColumnWidth( mnColumn ) ),
+ (mnLine == CSV_LINE_HEADER) ? rGrid.GetHdrHeight() : rGrid.GetLineHeight() );
}
Rectangle ScAccessibleCsvCell::implGetBoundingBox() const
@@ -1730,9 +1732,12 @@ Rectangle ScAccessibleCsvCell::implGetBoundingBox() const
ScCsvGrid& rGrid = implGetGrid();
Rectangle aClipRect( Point( 0, 0 ), rGrid.GetSizePixel() );
if( mnColumn != CSV_COLUMN_HEADER )
- aClipRect.Left() = rGrid.GetOffsetX();
+ {
+ aClipRect.Left() = rGrid.GetFirstX();
+ aClipRect.Right() = rGrid.GetLastX();
+ }
if( mnLine != CSV_LINE_HEADER )
- aClipRect.Top() = rGrid.GetOffsetY();
+ aClipRect.Top() = rGrid.GetHdrHeight();
Rectangle aRect( implGetRealPos(), implGetRealSize() );
aRect.Intersection( aClipRect );
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index f3f2f21d8dcb..1c5ca2093d5a 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleDocument.cxx,v $
*
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
- * last change: $Author: sab $ $Date: 2002-10-01 15:18:06 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -178,13 +178,14 @@ using namespace ::drafts::com::sun::star::accessibility;
struct ScAccessibleShapeData
{
- ScAccessibleShapeData() : pAccShape(NULL), pRelationCell(NULL), bSelected(sal_False) {}
+ ScAccessibleShapeData() : pAccShape(NULL), pRelationCell(NULL), bSelected(sal_False), bSelectable(sal_True) {}
~ScAccessibleShapeData();
mutable accessibility::AccessibleShape* pAccShape;
mutable ScAddress* pRelationCell; // if it is NULL this shape is anchored on the table
// SdrObject* pShape;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape;
mutable sal_Bool bSelected;
+ sal_Bool bSelectable;
};
ScAccessibleShapeData::~ScAccessibleShapeData()
@@ -298,7 +299,7 @@ struct SelectShape
SelectShape(uno::Reference& xTemp) : xShapes(xTemp) {}
void operator() (const ScAccessibleShapeData* pAccShapeData) const
{
- if (pAccShapeData)
+ if (pAccShapeData && pAccShapeData->bSelectable)
{
pAccShapeData->bSelected = sal_True;
if (pAccShapeData->pAccShape)
@@ -591,10 +592,10 @@ uno::Reference< XAccessible > ScChildrenShapes::Get(const ScAccessibleShapeData*
pData->pAccShape->acquire();
pData->pAccShape->Init();
if (pData->bSelected)
- {
pData->pAccShape->SetState(AccessibleStateType::SELECTED);
- pData->pAccShape->SetRelationSet(GetRelationSet(pData));
- }
+ if (!pData->bSelectable)
+ pData->pAccShape->ResetState(AccessibleStateType::SELECTABLE);
+ pData->pAccShape->SetRelationSet(GetRelationSet(pData));
}
}
return pData->pAccShape;
@@ -747,7 +748,7 @@ void ScChildrenShapes::Select(sal_Int32 nIndex)
return;
uno::Reference xShape;
- if (!IsSelected(nIndex, xShape))
+ if (!IsSelected(nIndex, xShape) && maZOrderedShapes[nIndex]->bSelectable)
{
uno::Reference xShapes;
xSelectionSupplier->getSelection() >>= xShapes;
@@ -1192,6 +1193,21 @@ void ScChildrenShapes::AddShape(const uno::Reference& xShape, s
SortedShapes::iterator aNewItr = maZOrderedShapes.insert(aFindItr, pShape);
SetAnchor(xShape, pShape);
+ uno::Reference< beans::XPropertySet > xShapeProp(xShape, uno::UNO_QUERY);
+ if (xShapeProp.is())
+ {
+ uno::Any aPropAny = xShapeProp->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "LayerID" )));
+ sal_Int16 nLayerID;
+ if( aPropAny >>= nLayerID )
+ {
+ if( nLayerID == SC_LAYER_INTERN )
+ pShape->bSelectable = sal_False;
+ else
+ pShape->bSelectable = sal_True;
+ }
+ }
+
+
if (!xSelectionSupplier.is())
throw uno::RuntimeException();
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 1b2853daec04..4ea2c1fbf3ef 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleDocumentPagePreview.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: sab $ $Date: 2002-11-21 16:54:21 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,6 +99,18 @@
#ifndef SC_SC_HRC
#include "sc.hrc"
#endif
+#ifndef _SC_DRAWMODELBROADCASTER_HXX
+#include "DrawModelBroadcaster.hxx"
+#endif
+#ifndef SC_DOCSHELL_HXX
+#include "docsh.hxx"
+#endif
+#ifndef SC_DRAWVIEW_HXX
+#include "drawview.hxx"
+#endif
+#ifndef SC_PREVIEW_HXX
+#include "preview.hxx"
+#endif
#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
#include
@@ -600,6 +612,121 @@ inline ScDocument* ScNotesChilds::GetDocument() const
return pDoc;
}
+class ScIAccessibleViewForwarder : public accessibility::IAccessibleViewForwarder
+{
+public:
+ ScIAccessibleViewForwarder();
+ ScIAccessibleViewForwarder(ScPreviewShell* pViewShell,
+ ScAccessibleDocumentPagePreview* pAccDoc,
+ const MapMode& aMapMode);
+ ~ScIAccessibleViewForwarder();
+
+ ///===== IAccessibleViewForwarder ========================================
+
+ virtual sal_Bool IsValid (void) const;
+ virtual Rectangle GetVisibleArea() const;
+ virtual Point LogicToPixel (const Point& rPoint) const;
+ virtual Size LogicToPixel (const Size& rSize) const;
+ virtual Point PixelToLogic (const Point& rPoint) const;
+ virtual Size PixelToLogic (const Size& rSize) const;
+
+private:
+ ScPreviewShell* mpViewShell;
+ ScAccessibleDocumentPagePreview* mpAccDoc;
+ MapMode maMapMode;
+ sal_Bool mbValid;
+};
+
+ScIAccessibleViewForwarder::ScIAccessibleViewForwarder()
+ : mbValid(sal_False)
+{
+}
+
+ScIAccessibleViewForwarder::ScIAccessibleViewForwarder(ScPreviewShell* pViewShell,
+ ScAccessibleDocumentPagePreview* pAccDoc,
+ const MapMode& aMapMode)
+ : mpViewShell(pViewShell),
+ mpAccDoc(pAccDoc),
+ maMapMode(aMapMode),
+ mbValid(sal_True)
+{
+}
+
+ScIAccessibleViewForwarder::~ScIAccessibleViewForwarder()
+{
+}
+
+///===== IAccessibleViewForwarder ========================================
+
+sal_Bool ScIAccessibleViewForwarder::IsValid (void) const
+{
+ ScUnoGuard aGuard;
+ return mbValid;
+}
+
+Rectangle ScIAccessibleViewForwarder::GetVisibleArea() const
+{
+ ScUnoGuard aGuard;
+ Rectangle aVisRect;
+ Window* pWin = mpViewShell->GetWindow();
+ if (pWin)
+ {
+ aVisRect.SetSize(pWin->GetOutputSizePixel());
+ aVisRect.SetPos(Point(0, 0));
+
+ aVisRect = pWin->PixelToLogic(aVisRect, maMapMode);
+ }
+
+ return aVisRect;
+}
+
+Point ScIAccessibleViewForwarder::LogicToPixel (const Point& rPoint) const
+{
+ ScUnoGuard aGuard;
+ Point aPoint;
+ Window* pWin = mpViewShell->GetWindow();
+ if (pWin && mpAccDoc)
+ {
+ Rectangle aRect(mpAccDoc->GetBoundingBoxOnScreen());
+ aPoint = pWin->LogicToPixel(rPoint, maMapMode) + aRect.TopLeft();
+ }
+
+ return aPoint;
+}
+
+Size ScIAccessibleViewForwarder::LogicToPixel (const Size& rSize) const
+{
+ ScUnoGuard aGuard;
+ Size aSize;
+ Window* pWin = mpViewShell->GetWindow();
+ if (pWin)
+ aSize = pWin->LogicToPixel(rSize, maMapMode);
+ return aSize;
+}
+
+Point ScIAccessibleViewForwarder::PixelToLogic (const Point& rPoint) const
+{
+ ScUnoGuard aGuard;
+ Point aPoint;
+ Window* pWin = mpViewShell->GetWindow();
+ if (pWin && mpAccDoc)
+ {
+ Rectangle aRect(mpAccDoc->GetBoundingBoxOnScreen());
+ aPoint = pWin->PixelToLogic(rPoint - aRect.TopLeft(), maMapMode);
+ }
+ return aPoint;
+}
+
+Size ScIAccessibleViewForwarder::PixelToLogic (const Size& rSize) const
+{
+ ScUnoGuard aGuard;
+ Size aSize;
+ Window* pWin = mpViewShell->GetWindow();
+ if (pWin)
+ aSize = pWin->PixelToLogic(rSize, maMapMode);
+ return aSize;
+}
+
struct ScShapeChild
{
ScShapeChild() : mpAccShape(NULL) {}
@@ -607,12 +734,14 @@ struct ScShapeChild
~ScShapeChild();
mutable accessibility::AccessibleShape* mpAccShape;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
+ sal_Int32 mnRangeId;
};
ScShapeChild::ScShapeChild(const ScShapeChild& rOld)
:
mpAccShape(rOld.mpAccShape),
-mxShape(rOld.mxShape)
+mxShape(rOld.mxShape),
+mnRangeId(rOld.mnRangeId)
{
if (mpAccShape)
mpAccShape->acquire();
@@ -644,12 +773,12 @@ struct ScShapeRange
ScShapeChildVec maControls;
Rectangle maPixelRect;
MapMode maMapMode;
+ ScIAccessibleViewForwarder maViewForwarder;
};
typedef std::vector ScShapeRangeVec;
class ScShapeChilds : public SfxListener,
- public accessibility::IAccessibleViewForwarder,
public accessibility::IAccessibleParent
{
public:
@@ -660,15 +789,6 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- ///===== IAccessibleViewForwarder ========================================
-
- virtual sal_Bool IsValid (void) const;
- virtual Rectangle GetVisibleArea() const;
- virtual Point LogicToPixel (const Point& rPoint) const;
- virtual Size LogicToPixel (const Size& rSize) const;
- virtual Point PixelToLogic (const Point& rPoint) const;
- virtual Size PixelToLogic (const Size& rSize) const;
-
///===== IAccessibleParent ==============================================
virtual sal_Bool ReplaceChild (
@@ -688,7 +808,8 @@ public:
uno::Reference GetForeShape(sal_Int32 nIndex) const;
sal_Int32 GetControlCount() const;
uno::Reference GetControl(sal_Int32 nIndex) const;
- uno::Reference GetAt(const awt::Point& rPoint) const;
+ uno::Reference GetForegroundShapeAt(const awt::Point& rPoint) const; // inclusive controls
+ uno::Reference GetBackgroundShapeAt(const awt::Point& rPoint) const;
void DataChanged();
void VisAreaChanged() const;
@@ -698,7 +819,6 @@ private:
ScAccessibleDocumentPagePreview* mpAccDoc;
ScPreviewShell* mpViewShell;
ScShapeRangeVec maShapeRanges;
- mutable accessibility::AccessibleShapeTreeInfo maShapeTreeInfo;
void FindChanged(ScShapeChildVec& aOld, ScShapeChildVec& aNew) const;
void FindChanged(ScShapeRange& aOld, ScShapeRange& aNew) const;
@@ -861,13 +981,13 @@ void ScShapeChilds::DataChanged()
struct ScVisAreaChanged
{
- const ScShapeChilds* mpAccDoc;
- ScVisAreaChanged(const ScShapeChilds* pAccDoc) : mpAccDoc(pAccDoc) {}
+ const ScIAccessibleViewForwarder* mpViewForwarder;
+ ScVisAreaChanged(const ScIAccessibleViewForwarder* pViewForwarder) : mpViewForwarder(pViewForwarder) {}
void operator() (const ScShapeChild& rAccShapeData) const
{
if (rAccShapeData.mpAccShape)
{
- rAccShapeData.mpAccShape->ViewForwarderChanged(accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc);
+ rAccShapeData.mpAccShape->ViewForwarderChanged(accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
}
}
};
@@ -876,9 +996,9 @@ void ScShapeChilds::VisAreaChanged() const
{
ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin();
- ScVisAreaChanged aVisAreaChanged(this);
while (aItr != aEndItr)
{
+ ScVisAreaChanged aVisAreaChanged(&(aItr->maViewForwarder));
std::for_each(aItr->maBackShapes.begin(), aItr->maBackShapes.end(), aVisAreaChanged);
std::for_each(aItr->maControls.begin(), aItr->maControls.end(), aVisAreaChanged);
std::for_each(aItr->maForeShapes.begin(), aItr->maForeShapes.end(), aVisAreaChanged);
@@ -886,71 +1006,6 @@ void ScShapeChilds::VisAreaChanged() const
}
}
-///===== IAccessibleViewForwarder ========================================
-
-sal_Bool ScShapeChilds::IsValid (void) const
-{
- ScUnoGuard aGuard;
- return (mpViewShell != NULL);
-}
-
-Rectangle ScShapeChilds::GetVisibleArea() const
-{
- ScUnoGuard aGuard;
- Rectangle aVisRect;
-
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- {
- aVisRect.SetSize(pWin->GetOutputSizePixel());
- aVisRect.SetPos(Point(0, 0));
-
- aVisRect = pWin->PixelToLogic(aVisRect, maShapeRanges[0].maMapMode);
- }
-
- return aVisRect;
-}
-
-Point ScShapeChilds::LogicToPixel (const Point& rPoint) const
-{
- ScUnoGuard aGuard;
- Point aPoint;
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- aPoint = pWin->LogicToPixel(rPoint, maShapeRanges[0].maMapMode);
- return aPoint;
-}
-
-Size ScShapeChilds::LogicToPixel (const Size& rSize) const
-{
- ScUnoGuard aGuard;
- Size aSize;
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- aSize = pWin->LogicToPixel(rSize, maShapeRanges[0].maMapMode);
- return aSize;
-}
-
-Point ScShapeChilds::PixelToLogic (const Point& rPoint) const
-{
- ScUnoGuard aGuard;
- Point aPoint;
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- aPoint = pWin->PixelToLogic(rPoint, maShapeRanges[0].maMapMode);
- return aPoint;
-}
-
-Size ScShapeChilds::PixelToLogic (const Size& rSize) const
-{
- ScUnoGuard aGuard;
- Size aSize;
- Window* pWin = mpViewShell->GetWindow();
- if (pWin)
- aSize = pWin->PixelToLogic(rSize, maShapeRanges[0].maMapMode);
- return aSize;
-}
-
///===== IAccessibleParent ==============================================
sal_Bool ScShapeChilds::ReplaceChild (accessibility::AccessibleShape* pCurrentChild,
@@ -1001,10 +1056,8 @@ uno::Reference ScShapeChilds::GetBackShape(sal_Int32 nIndex) const
if(nIndex < nCount)
xAccessible = GetAccShape(aItr->maBackShapes, nIndex);
else
- {
- nIndex -= nCount;
++aItr;
- }
+ nIndex -= nCount;
}
if (nIndex >= 0)
@@ -1033,10 +1086,8 @@ uno::Reference ScShapeChilds::GetForeShape(sal_Int32 nIndex) const
if(nIndex < nCount)
xAccessible = GetAccShape(aItr->maForeShapes, nIndex);
else
- {
- nIndex -= nCount;
++aItr;
- }
+ nIndex -= nCount;
}
if (nIndex >= 0)
@@ -1065,10 +1116,8 @@ uno::Reference ScShapeChilds::GetControl(sal_Int32 nIndex) const
if(nIndex < nCount)
xAccessible = GetAccShape(aItr->maControls, nIndex);
else
- {
- nIndex -= nCount;
++aItr;
- }
+ nIndex -= nCount;
}
if (nIndex >= 0)
@@ -1079,18 +1128,18 @@ uno::Reference ScShapeChilds::GetControl(sal_Int32 nIndex) const
struct ScShapePointFound
{
- Rectangle maPoint;
- ScShapePointFound(const awt::Point& rPoint) : maPoint(VCLPoint(rPoint), Size(0, 0)) {}
+ Point maPoint;
+ ScShapePointFound(const awt::Point& rPoint) : maPoint(VCLPoint(rPoint)) {}
sal_Bool operator() (const ScShapeChild& rShape)
{
sal_Bool bResult(sal_False);
- if (maPoint.IsInside(VCLRectangle(rShape.mpAccShape->getBounds())))
+ if ((VCLRectangle(rShape.mpAccShape->getBounds())).IsInside(maPoint))
bResult = sal_True;
return bResult;
}
};
-uno::Reference ScShapeChilds::GetAt(const awt::Point& rPoint) const
+uno::Reference ScShapeChilds::GetForegroundShapeAt(const awt::Point& rPoint) const //inclusive Controls
{
uno::Reference xAcc;
@@ -1107,15 +1156,25 @@ uno::Reference ScShapeChilds::GetAt(const awt::Point& rPoint) const
if (aFindItr != aItr->maControls.end())
xAcc = GetAccShape(*aFindItr);
else
- {
- ScShapeChildVec::const_iterator aFindItr = std::find_if(aItr->maBackShapes.begin(), aItr->maBackShapes.end(), ScShapePointFound(rPoint));
- if (aFindItr != aItr->maBackShapes.end())
- xAcc = GetAccShape(*aFindItr);
- else
- ++aItr;
- }
+ ++aItr;
}
- if (!xAcc.is())
+ }
+
+ return xAcc;
+}
+
+uno::Reference ScShapeChilds::GetBackgroundShapeAt(const awt::Point& rPoint) const
+{
+ uno::Reference xAcc;
+
+ ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin();
+ ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
+ while((aItr != aEndItr) && !xAcc.is())
+ {
+ ScShapeChildVec::const_iterator aFindItr = std::find_if(aItr->maBackShapes.begin(), aItr->maBackShapes.end(), ScShapePointFound(rPoint));
+ if (aFindItr != aItr->maBackShapes.end())
+ xAcc = GetAccShape(*aFindItr);
+ else
++aItr;
}
@@ -1128,11 +1187,20 @@ accessibility::AccessibleShape* ScShapeChilds::GetAccShape(const ScShapeChild& r
{
accessibility::ShapeTypeHandler& rShapeHandler = accessibility::ShapeTypeHandler::Instance();
accessibility::AccessibleShapeInfo aShapeInfo(rShape.mxShape, mpAccDoc, const_cast(this));
- rShape.mpAccShape = rShapeHandler.CreateAccessibleObject(aShapeInfo, maShapeTreeInfo);
- if (rShape.mpAccShape)
+
+ if (mpViewShell)
{
- rShape.mpAccShape->acquire();
- rShape.mpAccShape->Init();
+ accessibility::AccessibleShapeTreeInfo aShapeTreeInfo;
+ aShapeTreeInfo.SetSdrView(mpViewShell->GetPreview()->GetDrawView());
+ aShapeTreeInfo.SetController(NULL);
+ aShapeTreeInfo.SetWindow(mpViewShell->GetWindow());
+ aShapeTreeInfo.SetViewForwarder(&(maShapeRanges[rShape.mnRangeId].maViewForwarder));
+ rShape.mpAccShape = rShapeHandler.CreateAccessibleObject(aShapeInfo, aShapeTreeInfo);
+ if (rShape.mpAccShape)
+ {
+ rShape.mpAccShape->acquire();
+ rShape.mpAccShape->Init();
+ }
}
}
return rShape.mpAccShape;
@@ -1153,9 +1221,16 @@ void ScShapeChilds::FillShapes(const Rectangle& aPixelPaintRect, const MapMode&
sal_Bool bForeAdded(sal_False);
sal_Bool bBackAdded(sal_False);
sal_Bool bControlAdded(sal_False);
- Rectangle aLogicPaintRect(pWin->PixelToLogic(aPixelPaintRect, aMapMode));
- maShapeRanges[nRangeId].maPixelRect = aPixelPaintRect;
+ Rectangle aClippedPixelPaintRect(aPixelPaintRect);
+ if (mpAccDoc)
+ {
+ Rectangle aRect2(Point(0,0), mpAccDoc->GetBoundingBoxOnScreen().GetSize());
+ aClippedPixelPaintRect = aPixelPaintRect.GetIntersection(aRect2);
+ }
+ maShapeRanges[nRangeId].maPixelRect = aClippedPixelPaintRect;
maShapeRanges[nRangeId].maMapMode = aMapMode;
+ ScIAccessibleViewForwarder aViewForwarder(mpViewShell, mpAccDoc, aMapMode);
+ maShapeRanges[nRangeId].maViewForwarder = aViewForwarder;
sal_uInt32 nCount(pPage->GetObjCount());
for (sal_uInt32 i = 0; i < nCount; ++i)
{
@@ -1165,11 +1240,12 @@ void ScShapeChilds::FillShapes(const Rectangle& aPixelPaintRect, const MapMode&
uno::Reference< drawing::XShape > xShape(pObj->getUnoShape(), uno::UNO_QUERY);
if (xShape.is())
{
- Rectangle aRect(VCLPoint(xShape->getPosition()), VCLSize(xShape->getSize()));
- if(!aRect.GetIntersection(aLogicPaintRect).IsEmpty())
+ Rectangle aRect(pWin->LogicToPixel(VCLPoint(xShape->getPosition()), aMapMode), pWin->LogicToPixel(VCLSize(xShape->getSize()), aMapMode));
+ if(!aClippedPixelPaintRect.GetIntersection(aRect).IsEmpty())
{
ScShapeChild aShape;
aShape.mxShape = xShape;
+ aShape.mnRangeId = nRangeId;
switch (pObj->GetLayer())
{
case SC_LAYER_INTERN:
@@ -1608,11 +1684,25 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
if ( mpViewShell )
{
- const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
- ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
-
- if ( rData.HasCellsInRange( Rectangle( rPoint.X, rPoint.Y, rPoint.X, rPoint.Y ) ) )
+ xAccessible = GetShapeChilds()->GetForegroundShapeAt(rPoint);
+ if (!xAccessible.is())
{
+ const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
+ ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
+
+/* if ( rData.HasCellsInRange( Rectangle( rPoint, rPoint ) ) )
+ {
+ if ( !mpTable && (aCount.nTables > 0) )
+ {
+ //! 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();
+ }
+ xAccessible = mpTable;
+ }*/
if ( !mpTable && (aCount.nTables > 0) )
{
//! order is background shapes, header, table or notes, footer, foreground shapes, controls
@@ -1622,40 +1712,39 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces
mpTable->acquire();
mpTable->Init();
}
- xAccessible = mpTable;
+ if (mpTable && VCLRectangle(mpTable->getBounds()).IsInside(VCLPoint(rPoint)))
+ xAccessible = mpTable;
}
- else
- {
+ if (!xAccessible.is())
xAccessible = GetNotesChilds()->GetAt(rPoint);
- if (!xAccessible.is())
- xAccessible = GetShapeChilds()->GetAt(rPoint);
- if (!xAccessible.is())
+ if (!xAccessible.is())
+ {
+ if (!mpHeader || !mpFooter)
{
- if (!mpHeader || !mpFooter)
- {
- const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
- ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
+ const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
+ ScPagePreviewCountData aCount( rData, mpViewShell->GetWindow(), GetNotesChilds(), GetShapeChilds() );
- if (!mpHeader)
- {
- mpHeader = new ScAccessiblePageHeader( this, mpViewShell, sal_True, aCount.nBackShapes + aCount.nHeaders - 1);
- mpHeader->acquire();
- }
- if (!mpFooter)
- {
- mpFooter = new ScAccessiblePageHeader( this, mpViewShell, sal_False, aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs + aCount.nFooters - 1 );
- mpFooter->acquire();
- }
+ if (!mpHeader)
+ {
+ mpHeader = new ScAccessiblePageHeader( this, mpViewShell, sal_True, aCount.nBackShapes + aCount.nHeaders - 1);
+ mpHeader->acquire();
+ }
+ if (!mpFooter)
+ {
+ mpFooter = new ScAccessiblePageHeader( this, mpViewShell, sal_False, aCount.nBackShapes + aCount.nHeaders + aCount.nTables + aCount.nNoteParagraphs + aCount.nFooters - 1 );
+ mpFooter->acquire();
}
+ }
- Point aPoint(VCLPoint(rPoint));
+ Point aPoint(VCLPoint(rPoint));
- if (VCLRectangle(mpHeader->getBounds()).IsInside(aPoint))
- xAccessible = mpHeader;
- else if (VCLRectangle(mpFooter->getBounds()).IsInside(aPoint))
- xAccessible = mpFooter;
- }
+ if (VCLRectangle(mpHeader->getBounds()).IsInside(aPoint))
+ xAccessible = mpHeader;
+ else if (VCLRectangle(mpFooter->getBounds()).IsInside(aPoint))
+ xAccessible = mpFooter;
}
+ if (!xAccessible.is())
+ xAccessible = GetShapeChilds()->GetBackgroundShapeAt(rPoint);
}
}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index cea2d295f128..5e7ed22a5504 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessiblePreviewHeaderCell.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: sab $ $Date: 2002-11-27 14:21:16 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,6 +101,9 @@
#ifndef _COMPHELPER_SEQUENCE_HXX_
#include
#endif
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include
+#endif
using namespace ::com::sun::star;
using namespace ::drafts::com::sun::star::accessibility;
@@ -111,15 +114,15 @@ ScAccessiblePreviewHeaderCell::ScAccessiblePreviewHeaderCell( const ::com::sun::
::drafts::com::sun::star::accessibility::XAccessible>& rxParent,
ScPreviewShell* pViewShell,
const ScAddress& rCellPos, sal_Bool bIsColHdr, sal_Bool bIsRowHdr,
- sal_Int32 nIndex, const Rectangle& rPosition ) :
+ sal_Int32 nIndex ) :
ScAccessibleContextBase( rxParent, AccessibleRole::TABLE_CELL ),
mpViewShell( pViewShell ),
maCellPos( rCellPos ),
mbColumnHeader( bIsColHdr ),
mbRowHeader( bIsRowHdr ),
mnIndex( nIndex ),
- maPosition( rPosition ),
- mpTextHelper( NULL )
+ mpTextHelper( NULL ),
+ mpTableInfo( NULL )
{
if (mpViewShell)
mpViewShell->AddAccessibilityObject(*this);
@@ -140,6 +143,9 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
mpViewShell = NULL;
}
+ if (mpTableInfo)
+ DELETEZ (mpTableInfo);
+
ScAccessibleContextBase::disposing();
}
@@ -151,11 +157,17 @@ void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint&
{
const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
ULONG nId = rRef.GetId();
- if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ if (nId == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
mpTextHelper->UpdateChildren();
}
+ else if ( nId == SFX_HINT_DATACHANGED )
+ {
+ // column / row layout may change with any document change,
+ // so it must be invalidated
+ DELETEZ( mpTableInfo );
+ }
}
ScAccessibleContextBase::Notify(rBC, rHint);
@@ -186,27 +198,48 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::release()
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getCurrentValue() throw (uno::RuntimeException)
{
- // column or row headers don't have a value
- return uno::Any();
+ ScUnoGuard aGuard;
+ IsObjectValid();
+
+ double fValue(0.0);
+ if (mbColumnHeader)
+ fValue = maCellPos.Col();
+ else
+ fValue = maCellPos.Row();
+
+ uno::Any aAny;
+ aAny <<= fValue;
+ return aAny;
}
sal_Bool SAL_CALL ScAccessiblePreviewHeaderCell::setCurrentValue( const uno::Any& aNumber )
throw (uno::RuntimeException)
{
- // column or row headers don't have a value
+ // it is not possible to set a value
return sal_False;
}
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMaximumValue() throw (uno::RuntimeException)
{
- // column or row headers don't have a value
- return uno::Any();
+ ScUnoGuard aGuard;
+ IsObjectValid();
+
+ double fValue(0.0);
+ if (mbColumnHeader)
+ fValue = MAXCOL;
+ else
+ fValue = MAXROW;
+ uno::Any aAny;
+ aAny <<= fValue;
+ return aAny;
}
uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMinimumValue() throw (uno::RuntimeException)
{
- // column or row headers don't have a value
- return uno::Any();
+ double fValue(0.0);
+ uno::Any aAny;
+ aAny <<= fValue;
+ return aAny;
}
//===== XAccessibleComponent ============================================
@@ -341,7 +374,18 @@ uno::Sequence SAL_CALL
Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() const throw (uno::RuntimeException)
{
- Rectangle aCellRect(GetBoundingBox());
+ Rectangle aCellRect;
+
+ FillTableInfo();
+
+ if (mpTableInfo)
+ {
+ const ScPreviewColRowInfo& rColInfo = mpTableInfo->GetColInfo()[maCellPos.Col()];
+ const ScPreviewColRowInfo& rRowInfo = mpTableInfo->GetRowInfo()[maCellPos.Row()];
+
+ aCellRect = Rectangle( rColInfo.nPixelStart, rRowInfo.nPixelStart, rColInfo.nPixelEnd, rRowInfo.nPixelEnd );
+ }
+
if (mpViewShell)
{
Window* pWindow = mpViewShell->GetWindow();
@@ -357,7 +401,29 @@ Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() const throw (u
Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const throw (uno::RuntimeException)
{
- return maPosition;
+ FillTableInfo();
+
+ if (mpTableInfo)
+ {
+ const ScPreviewColRowInfo& rColInfo = mpTableInfo->GetColInfo()[maCellPos.Col()];
+ const ScPreviewColRowInfo& rRowInfo = mpTableInfo->GetRowInfo()[maCellPos.Row()];
+
+ Rectangle aCellRect( rColInfo.nPixelStart, rRowInfo.nPixelStart, rColInfo.nPixelEnd, rRowInfo.nPixelEnd );
+ uno::Reference xAccParent = const_cast(this)->getAccessibleParent();
+ if (xAccParent.is())
+ {
+ uno::Reference xAccParentContext = xAccParent->getAccessibleContext();
+ uno::Reference xAccParentComp (xAccParentContext, uno::UNO_QUERY);
+ if (xAccParentComp.is())
+ {
+ Rectangle aParentRect (VCLRectangle(xAccParentComp->getBounds()));
+ aCellRect.setX(aCellRect.getX() - aParentRect.getX());
+ aCellRect.setY(aCellRect.getY() - aParentRect.getY());
+ }
+ }
+ return aCellRect;
+ }
+ return Rectangle();
}
rtl::OUString SAL_CALL ScAccessiblePreviewHeaderCell::createAccessibleDescription() throw(uno::RuntimeException)
@@ -411,3 +477,19 @@ void ScAccessiblePreviewHeaderCell::CreateTextHelper()
mpTextHelper->SetEventSource(this);
}
}
+
+void ScAccessiblePreviewHeaderCell::FillTableInfo() const
+{
+ if ( mpViewShell && !mpTableInfo )
+ {
+ Size aOutputSize;
+ Window* pWindow = mpViewShell->GetWindow();
+ if ( pWindow )
+ aOutputSize = pWindow->GetOutputSizePixel();
+ Point aPoint;
+ Rectangle aVisRect( aPoint, aOutputSize );
+
+ mpTableInfo = new ScPreviewTableInfo;
+ mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo );
+ }
+}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 338d679e864e..5705aec0818d 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessiblePreviewTable.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: sab $ $Date: 2002-11-15 09:34:12 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -237,6 +237,11 @@ rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleRowDescription( sa
else
throw lang::IndexOutOfBoundsException();*/
+ ScUnoGuard aGuard;
+ FillTableInfo();
+ if ( nRow < 0 || (mpTableInfo && nRow >= mpTableInfo->GetRows()) )
+ throw lang::IndexOutOfBoundsException();
+
return rtl::OUString();
}
@@ -268,6 +273,11 @@ rtl::OUString SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnDescription(
else
throw lang::IndexOutOfBoundsException();*/
+ ScUnoGuard aGuard;
+ FillTableInfo();
+ if ( nColumn < 0 || (mpTableInfo && nColumn >= mpTableInfo->GetCols()) )
+ throw lang::IndexOutOfBoundsException();
+
return rtl::OUString();
}
@@ -367,6 +377,12 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleRowSelected( sal_Int32 n
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
// in the page preview, there is no selection
+
+ ScUnoGuard aGuard;
+ FillTableInfo();
+ if ( nRow < 0 || (mpTableInfo && nRow >= mpTableInfo->GetRows()) )
+ throw lang::IndexOutOfBoundsException();
+
return sal_False;
}
@@ -374,6 +390,12 @@ sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleColumnSelected( sal_Int3
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
// in the page preview, there is no selection
+
+ ScUnoGuard aGuard;
+ FillTableInfo();
+ if ( nColumn < 0 || (mpTableInfo && nColumn >= mpTableInfo->GetCols()) )
+ throw lang::IndexOutOfBoundsException();
+
return sal_False;
}
@@ -397,9 +419,8 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCe
ScAddress aCellPos( rColInfo.nDocIndex, rRowInfo.nDocIndex, mpTableInfo->GetTab() );
if ( rColInfo.bIsHeader || rRowInfo.bIsHeader )
{
- Rectangle aPosition( rColInfo.nPixelStart, rRowInfo.nPixelStart, rColInfo.nPixelEnd, rRowInfo.nPixelEnd );
ScAccessiblePreviewHeaderCell* pHeaderCell = new ScAccessiblePreviewHeaderCell( this, mpViewShell, aCellPos,
- rRowInfo.bIsHeader, rColInfo.bIsHeader, nNewIndex, aPosition );
+ rRowInfo.bIsHeader, rColInfo.bIsHeader, nNewIndex );
xRet = pHeaderCell;
pHeaderCell->Init();
}
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index c520adfc3e3f..8ae9b0f26d2c 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleSpreadsheet.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: sab $ $Date: 2002-11-15 09:34:12 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -111,8 +111,8 @@
#ifndef _SV_GEN_HXX
#include
#endif
-#ifndef _SVX_COLORCFG_HXX
-#include
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include
#endif
#include
@@ -345,7 +345,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
else if (rHint.ISA( ScUpdateRefHint ))
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- if (rRef.GetMode() == URM_INSDEL)
+ if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //#107250# test whether table is inserted or deleted
{
if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
(rRef.GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
@@ -592,7 +592,7 @@ sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getBackground( )
{
ScUnoGuard aGuard;
IsObjectValid();
- return SC_MOD()->GetColorConfig().GetColorValue( ::svx::DOCCOLOR ).nColor;
+ return SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
}
//===== XAccessibleContext ==============================================
@@ -700,7 +700,9 @@ sal_Int32 SAL_CALL
if (!mpMarkedRanges)
{
mpMarkedRanges = new ScRangeList();
- mpViewShell->GetViewData()->GetMarkData().FillRangeListWithMarks(mpMarkedRanges, sal_False);
+ ScMarkData aMarkData(mpViewShell->GetViewData()->GetMarkData());
+ aMarkData.MarkToMulti();
+ aMarkData.FillRangeListWithMarks(mpMarkedRanges, sal_False);
}
// is possible, because there shouldn't be overlapped ranges in it
if (mpMarkedRanges)
@@ -983,4 +985,4 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea)
}
else
return Rectangle();
-}
\ No newline at end of file
+}
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index 0b89e60e45e6..e9cfc788aeaa 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleTableBase.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: sab $ $Date: 2002-09-24 13:01:59 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,6 +169,10 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
DBG_ERROR("Here should be a implementation to fill the description");
+
+ if ((nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
+ throw lang::IndexOutOfBoundsException();
+
//setAccessibleRowDescription(nRow, xAccessible); // to remember the created Description
return rtl::OUString();
}
@@ -177,6 +181,10 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
DBG_ERROR("Here should be a implementation to fill the description");
+
+ if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0))
+ throw lang::IndexOutOfBoundsException();
+
//setAccessibleColumnDescription(nColumn, xAccessible); // to remember the created Description
return rtl::OUString();
}
@@ -244,6 +252,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleTableBase::getAccessible
{
uno::Reference< XAccessibleTable > xAccessibleTable;
DBG_ERROR("Here should be a implementation to fill the row headers");
+
//CommitChange
return xAccessibleTable;
}
@@ -253,6 +262,7 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleTableBase::getAccessible
{
uno::Reference< XAccessibleTable > xAccessibleTable;
DBG_ERROR("Here should be a implementation to fill the column headers");
+
//CommitChange
return xAccessibleTable;
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 6cb16424e79c..153aff8908bb 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleText.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: sab $ $Date: 2002-11-11 09:56:25 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,6 +136,8 @@ public:
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+
+ void SetInvalid();
};
ScViewForwarder::ScViewForwarder(ScTabViewShell* pViewShell, ScSplitPos eSplitPos, const ScAddress& rCell)
@@ -207,6 +209,10 @@ Point ScViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMod
return Point();
}
+void ScViewForwarder::SetInvalid()
+{
+ mpViewShell = NULL;
+}
// ============================================================================
@@ -221,6 +227,8 @@ public:
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+
+ void SetInvalid();
};
ScEditObjectViewForwarder::ScEditObjectViewForwarder(Window* pWindow)
@@ -272,6 +280,10 @@ Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMod
return Point();
}
+void ScEditObjectViewForwarder::SetInvalid()
+{
+ mpWindow = NULL;
+}
// ============================================================================
@@ -289,6 +301,8 @@ public:
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ void SetInvalid();
+
Rectangle GetVisRect() const;
void FillTableInfo() const;
@@ -358,6 +372,11 @@ Point ScPreviewViewForwarder::PixelToLogic( const Point& rPoint, const MapMode&
return Point();
}
+void ScPreviewViewForwarder::SetInvalid()
+{
+ mpViewShell = NULL;
+}
+
Rectangle ScPreviewViewForwarder::GetVisRect() const
{
if ( mpViewShell )
@@ -600,6 +619,8 @@ public:
virtual sal_Bool Paste();
void GrabFocus();
+
+ void SetInvalid();
};
ScEditViewForwarder::ScEditViewForwarder(EditView* pEditView, Window* pWin)
@@ -724,6 +745,11 @@ void ScEditViewForwarder::GrabFocus()
{
}
+void ScEditViewForwarder::SetInvalid()
+{
+ mpWindow = NULL;
+ mpEditView = NULL;
+}
// ============================================================================
@@ -758,6 +784,10 @@ void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
+ if (mpEditViewForwarder)
+ mpEditViewForwarder->SetInvalid();
}
}
ScAccessibleCellBaseTextData::Notify(rBC, rHint);
@@ -942,6 +972,10 @@ void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint&
mpEditView = NULL;
mpEditEngine = NULL;
DELETEZ(mpForwarder);
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
+ if (mpEditViewForwarder)
+ mpEditViewForwarder->SetInvalid();
}
}
ScAccessibleTextData::Notify(rBC, rHint);
@@ -1204,6 +1238,8 @@ void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
}
}
ScAccessibleCellBaseTextData::Notify(rBC, rHint);
@@ -1295,6 +1331,8 @@ void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const S
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
}
}
ScAccessibleCellBaseTextData::Notify(rBC, rHint);
@@ -1439,6 +1477,8 @@ void ScAccessibleHeaderTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHi
{
mpViewShell = NULL;// invalid now
mpDocSh = NULL;
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
}
}
}
@@ -1554,6 +1594,8 @@ void ScAccessibleNoteTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{
mpViewShell = NULL;// invalid now
mpDocSh = NULL;
+ if (mpViewForwarder)
+ mpViewForwarder->SetInvalid();
}
}
}
@@ -1638,6 +1680,8 @@ public:
virtual Rectangle GetVisArea() const;
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+
+ void SetInvalid();
};
ScCsvViewForwarder::ScCsvViewForwarder( Window* pWindow, const Rectangle& rBoundBox ) :
@@ -1668,6 +1712,10 @@ Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMap
return mpWindow->PixelToLogic( rPoint, rMapMode );
}
+void ScCsvViewForwarder::SetInvalid()
+{
+ mpWindow = NULL;
+}
// ----------------------------------------------------------------------------
@@ -1695,8 +1743,8 @@ void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{
mpWindow = NULL;
mpEditEngine = NULL;
- mpTextForwarder.reset( NULL );
- mpViewForwarder.reset( NULL );
+ if (mpViewForwarder.get())
+ mpViewForwarder->SetInvalid();
}
}
ScAccessibleTextData::Notify( rBC, rHint );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index c959523afbb0..e0e029941d80 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inputhdl.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: nn $ $Date: 2002-12-04 18:53:48 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,7 +74,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -1549,7 +1549,7 @@ BOOL ScInputHandler::StartTable( sal_Unicode cTyped, BOOL bFromCommand )
// #105733# SvtAccessibilityOptions::GetIsForBorders is no longer used (always assumed TRUE)
if ( aBackCol.GetTransparency() > 0 ||
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- aBackCol.SetColor( pScMod->GetColorConfig().GetColorValue(svx::DOCCOLOR).nColor );
+ aBackCol.SetColor( pScMod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
pEngine->SetBackgroundColor( aBackCol );
// Ausrichtung
@@ -2030,7 +2030,21 @@ void ScInputHandler::EnterHandler( BYTE nBlockMode )
BOOL bSpellErrors = !bFormulaMode && pEngine->HasOnlineSpellErrors();
if ( bSpellErrors )
{
- // Test, ob Zahl, dann Fehler ignorieren
+ // #i3820# If the spell checker flags numerical input as error,
+ // it still has to be treated as number, not EditEngine object.
+
+ if ( pLastPattern && pActiveViewSh )
+ {
+ ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
+ SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ // without conditional format, as in ScColumn::SetString
+ ULONG nFormat = pLastPattern->GetNumberFormat( pFormatter );
+ double nVal;
+ if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
+ {
+ bSpellErrors = FALSE; // ignore the spelling errors
+ }
+ }
}
// After RemoveAdjust, the EditView must not be repainted (has wrong font size etc).
@@ -2647,12 +2661,17 @@ BOOL ScInputHandler::KeyInput( const KeyEvent& rKEvt, BOOL bStartEdit /* = FALSE
if (pTableView)
{
pTableView->GetEditEngine()->SetText( aStrLoP );
- pTableView->SetSelection( ESelection(0,0, 0,0) );
+ if ( aStrLoP.Len() )
+ pTableView->SetSelection( ESelection(0,0, 0,0) ); // before the '%'
+
+ // don't call SetSelection if the string is empty anyway,
+ // to avoid breaking the bInitial handling in ScViewData::EditGrowY
}
if (pTopView)
{
pTopView->GetEditEngine()->SetText( aStrLoP );
- pTopView->SetSelection( ESelection(0,0, 0,0) );
+ if ( aStrLoP.Len() )
+ pTopView->SetSelection( ESelection(0,0, 0,0) ); // before the '%'
}
}
SyncViews();
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a86ccca2237b..9e26da8243e4 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inputwin.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: sab $ $Date: 2002-11-29 13:46:47 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,11 +68,15 @@
//------------------------------------------------------------------
#include "scitems.hxx"
+#include "eetext.hxx"
#include
#define ITEMID_FIELD EE_FEATURE_FIELD
+#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -738,6 +742,10 @@ ScTextWnd::ScTextWnd( Window* pParent )
bFormulaMode ( FALSE ),
bInputMode ( FALSE )
{
+ EnableRTL( FALSE ); // #106269# EditEngine can't be used with VCL EnableRTL
+
+ bIsRTL = GetSettings().GetLayoutRTL();
+
// #79096# always use application font, so a font with cjk chars can be installed
Font aAppFont = GetFont();
aTextFont = aAppFont;
@@ -781,8 +789,17 @@ void __EXPORT ScTextWnd::Paint( const Rectangle& rRec )
- LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
// if (nDiff<2) nDiff=2; // mind. 1 Pixel
- //! Clipping am rechten Rand?
- DrawText( PixelToLogic( Point( TEXT_STARTPOS, nDiff/2 ) ), aString );
+ long nStartPos = TEXT_STARTPOS;
+ if ( bIsRTL )
+ {
+ // right-align
+ nStartPos += GetOutputSizePixel().Width() - 2*TEXT_STARTPOS -
+ LogicToPixel( Size( GetTextWidth( aString ), 0 ) ).Width();
+
+ // LayoutMode isn't changed as long as ModifyRTLDefaults doesn't include SvxFrameDirectionItem
+ }
+
+ DrawText( PixelToLogic( Point( nStartPos, nDiff/2 ) ), aString );
}
}
@@ -799,7 +816,7 @@ void __EXPORT ScTextWnd::Resize()
// passt sonst nicht zur normalen Textausgabe
#endif
- aSize.Width() -= 4;
+ aSize.Width() -= 2 * TEXT_STARTPOS - 1;
pEditView->SetOutputArea(
PixelToLogic( Rectangle( Point( TEXT_STARTPOS, (nDiff > 0) ? nDiff/2 : 1 ),
@@ -988,6 +1005,31 @@ void lcl_ExtendEditFontAttribs( SfxItemSet& rSet )
rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL );
}
+void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
+{
+ rSet.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
+
+ // always using rtl writing direction would break formulas
+ //rSet.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+
+ // PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's
+ // USHORT values in EditLine), so the text may be wrapped and line spacing must be
+ // increased to not see the beginning of the next line.
+ SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
+ aItem.SetPropLineSpace( 200 );
+ rSet.Put( aItem );
+}
+
+void lcl_ModifyRTLVisArea( EditView* pEditView )
+{
+ Rectangle aVisArea = pEditView->GetVisArea();
+ Size aPaper = pEditView->GetEditEngine()->GetPaperSize();
+ long nDiff = aPaper.Width() - aVisArea.Right();
+ aVisArea.Left() += nDiff;
+ aVisArea.Right() += nDiff;
+ pEditView->SetVisArea(aVisArea);
+}
+
void ScTextWnd::StartEditEngine()
{
// #31147# Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
@@ -1010,7 +1052,7 @@ void ScTextWnd::StartEditEngine()
pEditEngine = pNew;
pEditEngine->SetUpdateMode( FALSE );
- pEditEngine->SetPaperSize( Size( THESIZE, 300 ) ); //!!! size
+ pEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
pEditEngine->SetWordDelimiters(
ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
@@ -1022,6 +1064,8 @@ void ScTextWnd::StartEditEngine()
lcl_ExtendEditFontAttribs( *pSet );
// turn off script spacing to match DrawText output
pSet->Put( SvxScriptSpaceItem( FALSE, EE_PARA_ASIANCJKSPACING ) );
+ if ( bIsRTL )
+ lcl_ModifyRTLDefaults( *pSet );
pEditEngine->SetDefaults( pSet );
}
@@ -1052,10 +1096,24 @@ void ScTextWnd::StartEditEngine()
Resize();
+ if ( bIsRTL )
+ lcl_ModifyRTLVisArea( pEditView );
+
pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, NotifyHdl));
if (pAccTextData)
pAccTextData->StartEdit();
+
+ // as long as EditEngine and DrawText sometimes differ for CTL text,
+ // repaint now to have the EditEngine's version visible
+ SfxObjectShell* pObjSh = SfxObjectShell::Current();
+ if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ {
+ ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
+ BYTE nScript = pDoc->GetStringScriptType( aString );
+ if ( nScript & SCRIPTTYPE_COMPLEX )
+ Invalidate();
+ }
}
SC_MOD()->SetInputMode( SC_INPUT_TOP );
@@ -1126,19 +1184,26 @@ void ScTextWnd::SetTextString( const String& rNewString )
if (!pEditEngine)
{
- // test if CTL script type is involved
- BYTE nOldScript = 0;
- BYTE nNewScript = 0;
- SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ BOOL bPaintAll;
+ if ( bIsRTL )
+ bPaintAll = TRUE;
+ else
{
- // any document can be used (used only for its break iterator)
- ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
- nOldScript = pDoc->GetStringScriptType( aString );
- nNewScript = pDoc->GetStringScriptType( rNewString );
+ // test if CTL script type is involved
+ BYTE nOldScript = 0;
+ BYTE nNewScript = 0;
+ SfxObjectShell* pObjSh = SfxObjectShell::Current();
+ if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ {
+ // any document can be used (used only for its break iterator)
+ ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ nOldScript = pDoc->GetStringScriptType( aString );
+ nNewScript = pDoc->GetStringScriptType( rNewString );
+ }
+ bPaintAll = ( nOldScript & SCRIPTTYPE_COMPLEX ) || ( nNewScript & SCRIPTTYPE_COMPLEX );
}
- if ( ( nOldScript & SCRIPTTYPE_COMPLEX ) || ( nNewScript & SCRIPTTYPE_COMPLEX ) )
+ if ( bPaintAll )
{
// if CTL is involved, the whole text has to be redrawn
Invalidate();
@@ -1224,11 +1289,13 @@ void ScTextWnd::MakeDialogEditView()
pEditEngine->SetUpdateMode( FALSE );
pEditEngine->SetWordDelimiters( pEditEngine->GetWordDelimiters() += '=' );
- pEditEngine->SetPaperSize( Size( THESIZE, 300 ) );
+ pEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
SfxItemSet* pSet = new SfxItemSet( pEditEngine->GetEmptyItemSet() );
pEditEngine->SetFontInfoInItemSet( *pSet, aTextFont );
lcl_ExtendEditFontAttribs( *pSet );
+ if ( bIsRTL )
+ lcl_ModifyRTLDefaults( *pSet );
pEditEngine->SetDefaults( pSet );
pEditEngine->SetUpdateMode( TRUE );
@@ -1237,12 +1304,17 @@ void ScTextWnd::MakeDialogEditView()
Resize();
+ if ( bIsRTL )
+ lcl_ModifyRTLVisArea( pEditView );
+
if (pAccTextData)
pAccTextData->StartEdit();
}
void ScTextWnd::ImplInitSettings()
{
+ bIsRTL = GetSettings().GetLayoutRTL();
+
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor= rStyleSettings.GetWindowColor();
diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx
index d00face575be..e59520a2f302 100644
--- a/sc/source/ui/app/msgpool.cxx
+++ b/sc/source/ui/app/msgpool.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: msgpool.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:53 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,7 +134,7 @@ __EXPORT ScMessagePool::~ScMessagePool()
SetSecondaryPool( NULL ); // before deleting defaults (accesses defaults)
for ( USHORT i=0; i <= MSGPOOL_END-MSGPOOL_START; i++ )
- SetRef( *ppPoolDefaults[i], 0 );
+ SetRefCount( *ppPoolDefaults[i], 0 );
delete[] ppPoolDefaults;
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 18b5c40923c1..99195f086b3c 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scdll.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: os $ $Date: 2002-09-13 13:47:00 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -156,12 +156,10 @@ void ScDLL::Init()
// the ScModule must be created
ScModuleDummy **ppShlPtr = (ScModuleDummy**) GetAppData(SHL_CALC);
SvFactory *pFact = (SvFactory*)(*ppShlPtr)->pScDocShellFactory;
- ScLibSignalFunc pFunc = (*ppShlPtr)->pSignalFunc;
delete (*ppShlPtr);
ScModule* pMod = new ScModule((SfxObjectFactory*)pFact);
(*ppShlPtr) = pMod;
(*ppShlPtr)->pScDocShellFactory = pFact;
- (*ppShlPtr)->pSignalFunc = pFunc;
ScGlobal::Init(); // erst wenn der ResManager initialisiert ist
// erst nach ScGlobal::Init duerfen die App-Optionen
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 24768f998a41..81fb98d4ce0c 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scmod.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: nn $ $Date: 2002-10-24 17:17:41 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:05:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,7 +87,7 @@
#include
#include
#include
-#include
+#include
#include