summaryrefslogtreecommitdiff
path: root/binfilter/bf_sw/source/core/inc
diff options
context:
space:
mode:
Diffstat (limited to 'binfilter/bf_sw/source/core/inc')
-rw-r--r--binfilter/bf_sw/source/core/inc/GetMetricVal.hxx57
-rw-r--r--binfilter/bf_sw/source/core/inc/SwPortionHandler.hxx107
-rw-r--r--binfilter/bf_sw/source/core/inc/SwXTextDefaults.hxx90
-rw-r--r--binfilter/bf_sw/source/core/inc/atrhndl.hxx173
-rw-r--r--binfilter/bf_sw/source/core/inc/blink.hxx69
-rw-r--r--binfilter/bf_sw/source/core/inc/bodyfrm.hxx55
-rw-r--r--binfilter/bf_sw/source/core/inc/cellfrm.hxx60
-rw-r--r--binfilter/bf_sw/source/core/inc/cntfrm.hxx119
-rw-r--r--binfilter/bf_sw/source/core/inc/colfrm.hxx49
-rw-r--r--binfilter/bf_sw/source/core/inc/dbg_lay.hxx122
-rw-r--r--binfilter/bf_sw/source/core/inc/dflyobj.hxx105
-rw-r--r--binfilter/bf_sw/source/core/inc/docfld.hxx171
-rw-r--r--binfilter/bf_sw/source/core/inc/docfunc.hxx72
-rw-r--r--binfilter/bf_sw/source/core/inc/doctxm.hxx127
-rw-r--r--binfilter/bf_sw/source/core/inc/drawdev.hxx143
-rw-r--r--binfilter/bf_sw/source/core/inc/drawfont.hxx767
-rw-r--r--binfilter/bf_sw/source/core/inc/dview.hxx69
-rw-r--r--binfilter/bf_sw/source/core/inc/flowfrm.hxx194
-rw-r--r--binfilter/bf_sw/source/core/inc/flyfrm.hxx227
-rw-r--r--binfilter/bf_sw/source/core/inc/flyfrms.hxx169
-rw-r--r--binfilter/bf_sw/source/core/inc/fntcache.hxx157
-rw-r--r--binfilter/bf_sw/source/core/inc/frame.hxx1093
-rw-r--r--binfilter/bf_sw/source/core/inc/frmsh.hxx56
-rw-r--r--binfilter/bf_sw/source/core/inc/frmtool.hxx460
-rw-r--r--binfilter/bf_sw/source/core/inc/ftnboss.hxx128
-rw-r--r--binfilter/bf_sw/source/core/inc/ftnfrm.hxx126
-rw-r--r--binfilter/bf_sw/source/core/inc/hffrm.hxx71
-rw-r--r--binfilter/bf_sw/source/core/inc/layact.hxx245
-rw-r--r--binfilter/bf_sw/source/core/inc/laycache.hxx79
-rw-r--r--binfilter/bf_sw/source/core/inc/layfrm.hxx184
-rw-r--r--binfilter/bf_sw/source/core/inc/layouter.hxx60
-rw-r--r--binfilter/bf_sw/source/core/inc/mvsave.hxx212
-rw-r--r--binfilter/bf_sw/source/core/inc/node2lay.hxx81
-rw-r--r--binfilter/bf_sw/source/core/inc/noteurl.hxx78
-rw-r--r--binfilter/bf_sw/source/core/inc/notxtfrm.hxx86
-rw-r--r--binfilter/bf_sw/source/core/inc/numpara.hxx72
-rw-r--r--binfilter/bf_sw/source/core/inc/pagefrm.hxx435
-rw-r--r--binfilter/bf_sw/source/core/inc/pamtyp.hxx105
-rw-r--r--binfilter/bf_sw/source/core/inc/prevwpage.hxx41
-rw-r--r--binfilter/bf_sw/source/core/inc/ptqueue.hxx65
-rw-r--r--binfilter/bf_sw/source/core/inc/rootfrm.hxx325
-rw-r--r--binfilter/bf_sw/source/core/inc/rowfrm.hxx76
-rw-r--r--binfilter/bf_sw/source/core/inc/scrrect.hxx142
-rw-r--r--binfilter/bf_sw/source/core/inc/sectfrm.hxx154
-rw-r--r--binfilter/bf_sw/source/core/inc/setmapvirtdev.hxx76
-rw-r--r--binfilter/bf_sw/source/core/inc/splargs.hxx163
-rw-r--r--binfilter/bf_sw/source/core/inc/splcstk.hxx71
-rw-r--r--binfilter/bf_sw/source/core/inc/swblocks.hxx80
-rw-r--r--binfilter/bf_sw/source/core/inc/swcache.hxx304
-rw-r--r--binfilter/bf_sw/source/core/inc/swfntcch.hxx105
-rw-r--r--binfilter/bf_sw/source/core/inc/swfont.hxx859
-rw-r--r--binfilter/bf_sw/source/core/inc/tabfrm.hxx159
-rw-r--r--binfilter/bf_sw/source/core/inc/tblrwcl.hxx219
-rw-r--r--binfilter/bf_sw/source/core/inc/toxhlp.hxx75
-rw-r--r--binfilter/bf_sw/source/core/inc/txmsrt.hxx195
-rw-r--r--binfilter/bf_sw/source/core/inc/txtfrm.hxx707
-rw-r--r--binfilter/bf_sw/source/core/inc/txttypes.hxx104
-rw-r--r--binfilter/bf_sw/source/core/inc/unoclbck.hxx56
-rw-r--r--binfilter/bf_sw/source/core/inc/unofldmid.h65
-rw-r--r--binfilter/bf_sw/source/core/inc/viewimp.hxx327
-rw-r--r--binfilter/bf_sw/source/core/inc/visiturl.hxx53
-rw-r--r--binfilter/bf_sw/source/core/inc/wrong.hxx87
62 files changed, 11181 insertions, 0 deletions
diff --git a/binfilter/bf_sw/source/core/inc/GetMetricVal.hxx b/binfilter/bf_sw/source/core/inc/GetMetricVal.hxx
new file mode 100644
index 000000000000..757d0dd4bf68
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/GetMetricVal.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _GETMETRICVAL_HXX
+#define _GETMETRICVAL_HXX
+namespace binfilter {
+
+#define CM_1 0 // 1 centimeter or 1/2 inch
+#define CM_05 1 // 0.5 centimeter or 1/4 inch
+#define CM_01 2 // 0.1 centimeter or 1/20 inch
+
+inline USHORT GetMetricVal( int n )
+{
+#ifdef USE_MEASUREMENT
+ USHORT nVal = MEASURE_METRIC == GetAppLocaleData().getMeasurementSystemEnum()
+ ? 567 // 1 cm
+ : 770; // 1/2 Inch
+#else
+ USHORT nVal = 567; // 1 cm
+#endif
+
+ if( CM_01 == n )
+ nVal /= 10;
+ else if( CM_05 == n )
+ nVal /= 2;
+ return nVal;
+}
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/SwPortionHandler.hxx b/binfilter/bf_sw/source/core/inc/SwPortionHandler.hxx
new file mode 100644
index 000000000000..53addf249c4a
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/SwPortionHandler.hxx
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SW_PORTIONHANDLER_HXX
+#define _SW_PORTIONHANDLER_HXX
+
+#include <tools/solar.h>
+class String;
+namespace binfilter {
+
+
+/** The SwPortionHandler interface implements a visitor for the layout
+ * engine's text portions. This can be used to gather information of
+ * the on-screen representation of a single paragraph.
+ *
+ * For each text portion, one of the methods text(...) or special(...)
+ * is called, depending on whether it is a 'normal' run of text, or
+ * any other portion. Additionally, the linebreak() method is called
+ * once at the end of every on-screen line.
+ *
+ * All parameters relate to the 'model string', which is the text string
+ * held by the corresponding SwTxtNode.
+ *
+ * The SwPortionHandler can be used with the
+ * SwTextFrame::VisitPortions(...) method.
+ */
+class SwPortionHandler
+{
+public:
+
+ SwPortionHandler() {} /// (emtpy) constructor
+
+ virtual ~SwPortionHandler() {} /// (empty) destructor
+
+ /** text portion. A run of nLength characters from the model
+ * string, that contains no special characters like embedded
+ * fields, etc. Thus, the on-screen text of this portion
+ * corresponds exactly to the corresponding characters in the
+ * model string.
+ */
+ virtual void Text(
+ USHORT nLength, /// length of this portion in the model string
+ USHORT nType /// type of this portion
+ ) = 0;
+
+ /** special portion. This method is called for every non-text
+ * portion. The parameters describe the length of the
+ * corresponding characters in the model string (often 0 or 1),
+ * the text which is displayed, and the type of the portion.
+ */
+ virtual void Special(
+ USHORT nLength, /// length of this portion in the model string
+ const String& rText, /// text which is painted on-screen
+ USHORT nType /// type of this portion
+ ) = 0;
+
+ /** line break. This method is called whenever a line break in the
+ * layout occurs.
+ */
+ virtual void LineBreak() = 0;
+
+ /** skip characters. The SwTxtFrame may only display partially
+ * display a certain paragraph (e.g. when the paragaph is split
+ * across multiple pages). In this case, the Skip() method must be
+ * called to inform the portion handler to ignore a certain run of
+ * characters in the 'model string'. Skip(), if used at all, must
+ * be called before any of the other methods is called. Calling
+ * Skip() between portions is not allowed.
+ */
+ virtual void Skip(
+ USHORT nLength /// number of 'model string' characters to be skipped
+ ) = 0;
+
+ /** end of paragraph. This method is to be called when all the
+ * paragraph's portions have been processed.
+ */
+ virtual void Finish() = 0;
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/SwXTextDefaults.hxx b/binfilter/bf_sw/source/core/inc/SwXTextDefaults.hxx
new file mode 100644
index 000000000000..2548c0ecbf16
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/SwXTextDefaults.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SW_XTEXT_DEFAULTS_HXX
+#define _SW_XTEXT_DEFAULTS_HXX
+
+#include <cppuhelper/implbase3.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <com/sun/star/beans/XPropertyState.hpp>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#include <doc.hxx>
+#include <bf_svtools/itemprop.hxx>
+namespace binfilter {
+
+class SwXTextDefaults : public cppu::WeakImplHelper3
+ <
+ ::com::sun::star::beans::XPropertyState,
+ ::com::sun::star::beans::XPropertySet,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+ SfxItemPropertySet aPropSet;
+ SwDoc * pDoc;
+public:
+ SwXTextDefaults ( SwDoc * pNewDoc );
+ ~SwXTextDefaults ();
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& rPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XPropertyState
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& rPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& rPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& rPropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+};
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/atrhndl.hxx b/binfilter/bf_sw/source/core/inc/atrhndl.hxx
new file mode 100644
index 000000000000..27d306326dd8
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/atrhndl.hxx
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _ATRHNDL_HXX
+#define _ATRHNDL_HXX
+
+#define INITIAL_NUM_ATTR 4
+#define NUM_ATTRIBUTE_STACKS 37
+
+#include <txatbase.hxx>
+#include <swfntcch.hxx>
+
+namespace binfilter {
+class SfxPoolItem;
+class SwAttrSet;
+class SwDoc;
+class ViewShell;
+
+extern const BYTE StackPos[];
+
+/*************************************************************************
+ * class SwAttrHandler
+ *
+ * Used by Attribute Iterators to organize attributes on stacks to
+ * find the valid attribute in each category
+ *************************************************************************/
+
+class SwAttrHandler
+{
+private:
+
+ /*************************************************************************
+ * class SwAttrStack
+ *
+ * Container for SwTxtAttr Objects
+ *************************************************************************/
+
+ class SwAttrStack
+ {
+ private:
+ SwTxtAttr* pInitialArray[ INITIAL_NUM_ATTR ];
+ SwTxtAttr** pArray;
+ USHORT nCount; // number of elements on stack
+ USHORT nSize; // number of positions in Array
+
+ public:
+ // Ctor, Dtor
+ inline SwAttrStack();
+ inline ~SwAttrStack() {
+ if ( nSize > INITIAL_NUM_ATTR ) delete [] pArray; }
+
+ // reset stack
+ inline void Reset() { nCount = 0; };
+
+ // insert on top
+ inline void Push( const SwTxtAttr& rAttr ) { Insert( rAttr, nCount ); };
+ // insert at specified position, take care for not inserting behind
+ // the value returned by Count()
+ void Insert( const SwTxtAttr& rAttr, const USHORT nPos );
+
+ // remove specified attribute
+ void Remove( const SwTxtAttr& rAttr );
+
+ // get attribute from top if exists, otherwise 0
+ const SwTxtAttr* Top() const;
+
+ // number of elements on stack
+ inline USHORT Count() const { return nCount; };
+
+ // returns position of rAttr on Stack if found, otherwise USHRT_MAX
+ // can be used for Remove of an attribute
+ USHORT Pos( const SwTxtAttr& rAttr ) const;
+ };
+
+ SwAttrStack aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
+ const SfxPoolItem* pDefaultArray[ NUM_DEFAULT_VALUES ];
+ const SwDoc* pDoc;
+ const ViewShell* pShell;
+ sal_Bool bVertLayout;
+
+ // This is the base font for the paragraph. It is stored in order to have
+ // a template, if we have to restart the attribute evaluation
+ SwFont* pFnt;
+
+ // change font according to pool item
+ void FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPush );
+
+ // push attribute to specified stack, returns true, if attribute has
+ // been pushed on top of stack (important for stacks containing different
+ // attributes with different priority and redlining)
+ sal_Bool Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem, SwFont& rFnt );
+
+ // apply top attribute on stack to font
+ void ActivateTop( SwFont& rFnt, USHORT nStackPos );
+
+public:
+ // Ctor
+ SwAttrHandler();
+ ~SwAttrHandler();
+
+ // set default attributes to values in rAttrSet or from cache
+ void Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAttrSet,
+ const SwDoc& rDoc, const ViewShell* pShell, SwFont& rFnt,
+ sal_Bool bVertLayout );
+
+ // remove everything from internal stacks, keep default data
+ void Reset( );
+
+ // insert specified attribute and change font
+ void PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt );
+
+ // remove specified attribute and reset font
+ void PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt );
+
+ // apply script dependent attributes
+// void ChangeScript( SwFont& rFnt, const BYTE nScr );
+
+ // returns the default value for stack nStack
+ inline const SfxPoolItem& GetDefault( const USHORT nAttribID ) const;
+ // do not call these if you only used the small init function
+ inline void ResetFont( SwFont& rFnt ) const;
+ inline const SwFont* GetFont() const;
+};
+
+inline const SfxPoolItem& SwAttrHandler::GetDefault( const USHORT nAttribID ) const
+{
+ ASSERT( 0 <= nAttribID && nAttribID < RES_TXTATR_END,
+ "this attrib does not ex."
+ );
+ ASSERT( pDefaultArray[ StackPos[ nAttribID ] ], "array not initialized" );
+ return *pDefaultArray[ StackPos[ nAttribID ] ];
+}
+
+inline void SwAttrHandler::ResetFont( SwFont& rFnt ) const
+{
+ ASSERT( pFnt, "ResetFont without a font" );
+ if ( pFnt )
+ rFnt = *pFnt;
+};
+
+inline const SwFont* SwAttrHandler::GetFont() const
+{
+ return pFnt;
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/blink.hxx b/binfilter/bf_sw/source/core/inc/blink.hxx
new file mode 100644
index 000000000000..823732cc8bb6
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/blink.hxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _BLINK_HXX
+#define _BLINK_HXX
+
+class SwLinePortion;
+class SwRootFrm;
+class SwTxtFrm;
+
+#include <bf_svtools/svarray.hxx>
+#include <tools/gen.hxx>
+namespace binfilter {
+
+class SwBlinkPortion
+{
+ Point aPos;
+ const SwLinePortion *pPor;
+ const SwRootFrm *pFrm;
+ USHORT nDir;
+public:
+ SwBlinkPortion( const SwLinePortion* pPortion, USHORT nDirection )
+ { pPor = pPortion; nDir = nDirection; }
+ SwBlinkPortion( const SwBlinkPortion* pBlink, const SwLinePortion* pPort )
+ { pPor = pPort; pFrm = pBlink->pFrm; aPos = pBlink->aPos; nDir = pBlink->nDir; }
+ void SetPos( const Point& aNew ){ aPos = aNew; }
+ const Point& GetPos() const{ return aPos; }
+ void SetRootFrm( const SwRootFrm* pNew ){ pFrm = pNew; }
+ const SwRootFrm* GetRootFrm() const{ return pFrm; }
+ const SwLinePortion *GetPortion() const{ return pPor; }
+ USHORT GetDirection() const { return nDir; }
+ BOOL operator<( const SwBlinkPortion& rBlinkPortion ) const
+ { return (long)pPor < (long)rBlinkPortion.pPor; }
+ BOOL operator==( const SwBlinkPortion& rBlinkPortion ) const
+ { return (long)pPor == (long)rBlinkPortion.pPor; }
+};
+
+typedef SwBlinkPortion* SwBlinkPortionPtr;
+SV_DECL_PTRARR_SORT_DEL(SwBlinkList, SwBlinkPortionPtr, 0, 10)
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/bodyfrm.hxx b/binfilter/bf_sw/source/core/inc/bodyfrm.hxx
new file mode 100644
index 000000000000..05baa5fef1e0
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/bodyfrm.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _BODYFRM_HXX
+#define _BODYFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+class SwBorderAttrs;
+
+class SwBodyFrm: public SwLayoutFrm
+{
+protected:
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+
+#if defined ( GCC) && defined ( C272 )
+ ~SwBodyFrm();
+#endif
+public:
+ SwBodyFrm( SwFrmFmt* );
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
+};
+
+} //namespace binfilter
+#endif //_BODYFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/cellfrm.hxx b/binfilter/bf_sw/source/core/inc/cellfrm.hxx
new file mode 100644
index 000000000000..80e7a3a20b24
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/cellfrm.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CELLFRM_HXX
+#define _CELLFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+class SwTableBox;
+struct SwCrsrMoveState;
+class SwBorderAttrs;
+
+class SwCellFrm: public SwLayoutFrm
+{
+ const SwTableBox *pTabBox;
+
+protected:
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+
+public:
+ SwCellFrm( const SwTableBox & );
+ ~SwCellFrm();
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ const SwTableBox *GetTabBox() const { return pTabBox; }
+ DECL_FIXEDMEMPOOL_NEWDEL(SwCellFrm)
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/cntfrm.hxx b/binfilter/bf_sw/source/core/inc/cntfrm.hxx
new file mode 100644
index 000000000000..5f595d46f109
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/cntfrm.hxx
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CNTFRM_HXX
+#define _CNTFRM_HXX
+
+#include "frame.hxx"
+#include "flowfrm.hxx"
+#include "cshtyp.hxx"
+namespace binfilter {
+
+class SwLayoutFrm;
+class SwPageFrm;
+class SwCntntNode;
+struct SwCrsrMoveState;
+class SwBorderAttrs;
+class SwAttrSetChg;
+
+//Implementiert in cntfrm.cxx, wird von cntfrm.cxx und crsrsh.cxx angezogen
+extern BOOL GetFrmInPage( const SwCntntFrm*, SwWhichPage, SwPosPage, SwPaM* );
+
+class SwCntntFrm: public SwFrm, public SwFlowFrm
+{
+ friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt ); //ruft MakePrtArea
+
+ BOOL _WouldFit( SwTwips nSpace, SwLayoutFrm *pNewUpper, BOOL bTstMove );
+ virtual void MakeAll();
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+
+ virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL& );
+
+protected:
+
+ BOOL MakePrtArea( const SwBorderAttrs & );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+
+ SwCntntFrm( SwCntntNode * const );
+
+public:
+ virtual ~SwCntntFrm();
+ TYPEINFO(); //bereits in Basisklassen drin
+
+ virtual void Cut();
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+
+ inline SwCntntNode *GetNode();
+ inline const SwCntntNode *GetNode() const;
+ USHORT GetSectionLevel();
+
+ inline const SwCntntFrm *GetFollow() const;
+ inline SwCntntFrm *GetFollow();
+
+ //Layoutabhaengiges Cursortravelling
+ inline BOOL StartNextPage( SwPaM * ) const;
+ inline BOOL StartPrevPage( SwPaM * ) const;
+ inline BOOL StartCurrPage( SwPaM * ) const;
+ inline BOOL EndCurrPage( SwPaM * ) const;
+ inline BOOL EndNextPage( SwPaM * ) const;
+ inline BOOL EndPrevPage( SwPaM * ) const;
+
+ //nMaxHeight liefert die benoetigte Hoehe,
+ //bSplit sagt, obj der Absatz gesplittet werden muss.
+ virtual BOOL WouldFit( SwTwips &nMaxHeight, BOOL &bSplit );
+
+};
+
+inline SwCntntNode *SwCntntFrm::GetNode()
+{
+ return (SwCntntNode*)GetDep();
+}
+inline const SwCntntNode *SwCntntFrm::GetNode() const
+{
+ return (SwCntntNode*)GetDep();
+}
+
+inline const SwCntntFrm *SwCntntFrm::GetFollow() const
+{
+ return (const SwCntntFrm*)SwFlowFrm::GetFollow();
+}
+inline SwCntntFrm *SwCntntFrm::GetFollow()
+{
+ return (SwCntntFrm*)SwFlowFrm::GetFollow();
+}
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/colfrm.hxx b/binfilter/bf_sw/source/core/inc/colfrm.hxx
new file mode 100644
index 000000000000..b5baeeed4118
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/colfrm.hxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _COLFRM_HXX
+#define _COLFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "ftnboss.hxx"
+namespace binfilter {
+
+
+class SwColumnFrm: public SwFtnBossFrm
+{
+public:
+ SwColumnFrm( SwFrmFmt* );
+ ~SwColumnFrm();
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwColumnFrm)
+};
+
+} //namespace binfilter
+#endif //_COLFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/dbg_lay.hxx b/binfilter/bf_sw/source/core/inc/dbg_lay.hxx
new file mode 100644
index 000000000000..92a463d933e7
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/dbg_lay.hxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _DBG_LAY_HXX
+#define _DBG_LAY_HXX
+
+
+#define PROT_FILE_INIT 0x00000000
+#define PROT_INIT 0x00000001
+#define PROT_MAKEALL 0x00000002
+#define PROT_MOVE_FWD 0x00000004
+#define PROT_MOVE_BWD 0x00000008
+#define PROT_GROW 0x00000010
+#define PROT_SHRINK 0x00000020
+#define PROT_GROW_TST 0x00000040
+#define PROT_SHRINK_TST 0x00000080
+#define PROT_SIZE 0x00000100
+#define PROT_PRTAREA 0x00000200
+#define PROT_POS 0x00000400
+#define PROT_ADJUSTN 0x00000800
+#define PROT_SECTION 0x00001000
+#define PROT_CUT 0x00002000
+#define PROT_PASTE 0x00004000
+#define PROT_LEAF 0x00008000
+#define PROT_TESTFORMAT 0x00010000
+#define PROT_FRMCHANGES 0x00020000
+#define PROT_SNAPSHOT 0x00040000
+
+#define ACT_START 1
+#define ACT_END 2
+#define ACT_CREATE_MASTER 3
+#define ACT_CREATE_FOLLOW 4
+#define ACT_DEL_MASTER 5
+#define ACT_DEL_FOLLOW 6
+#define ACT_MERGE 7
+#define ACT_NEXT_SECT 8
+#define ACT_PREV_SECT 9
+
+#define SNAP_LOWER 0x00000001
+#define SNAP_FLYFRAMES 0x00000002
+#define SNAP_TABLECONT 0x00000004
+
+#ifdef DBG_UTIL
+
+#include <tools/debug.hxx>
+namespace binfilter {
+class SwImplProtocol;
+class SwFrm;
+class SwImplEnterLeave;
+
+class SwProtocol
+{
+ static ULONG nRecord;
+ static SwImplProtocol* pImpl;
+ static BOOL Start() { return 0 != ( PROT_INIT & nRecord ); }
+public:
+ static ULONG Record() { return nRecord; }
+ static void SetRecord( ULONG nNew ) { nRecord = nNew; }
+ static BOOL Record( ULONG nFunc ) { return 0 != (( nFunc | PROT_INIT ) & nRecord); }
+ static void Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAction, void* pParam ){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 static void Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAction, void* pParam );
+ static void Init();
+ static void Stop();
+};
+
+class SwEnterLeave
+{
+ SwImplEnterLeave* pImpl;
+ void Ctor( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar ){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 void Ctor( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar );
+ void Dtor(){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 void Dtor();
+public:
+ SwEnterLeave( const SwFrm* pFrm, ULONG nFunc, ULONG nAct, void* pPar )
+ { if( SwProtocol::Record( nFunc ) ) Ctor( pFrm, nFunc, nAct, pPar ); else pImpl = NULL; }
+ ~SwEnterLeave() { if( pImpl ) Dtor(); }
+};
+
+#define PROTOCOL( pFrm, nFunc, nAct, pPar ) { if( SwProtocol::Record( nFunc ) )\
+ SwProtocol::Record( pFrm, nFunc, nAct, pPar ); }
+#define PROTOCOL_INIT SwProtocol::Init();
+#define PROTOCOL_STOP SwProtocol::Stop();
+#define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar ) SwEnterLeave aEnter( pFrm, nFunc, nAct, pPar );
+#define PROTOCOL_SNAPSHOT( pFrm, nFlags ) SwProtocol::SnapShot( pFrm, nFlags );
+#define GET_VARIABLE( nNo, nVar ) SwProtocol::GetVar( nNo, nVar );
+} //STRIP008 end of namespace binfilter
+#else
+namespace binfilter {
+#define PROTOCOL( pFrm, nFunc, nAct, pPar )
+#define PROTOCOL_INIT
+#define PROTOCOL_STOP
+#define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar )
+#define PROTOCOL_SNAPSHOT( pFrm, nFlags )
+#define GET_VARIABLE( nNo, nVar )
+} //namespace binfilter
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/dflyobj.hxx b/binfilter/bf_sw/source/core/inc/dflyobj.hxx
new file mode 100644
index 000000000000..3137bf273e0c
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/dflyobj.hxx
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _DFLYOBJ_HXX
+#define _DFLYOBJ_HXX
+
+#include <bf_svx/svdovirt.hxx>
+#include <bf_svx/svdobj.hxx>
+namespace binfilter {
+
+class SwFlyFrm;
+class SwFrmFmt;
+class SdrObjMacroHitRec;
+
+const UINT32 SWGInventor = UINT32('S')*0x00000001+
+ UINT32('W')*0x00000100+
+ UINT32('G')*0x00010000;
+
+const UINT16 SwFlyDrawObjIdentifier = 0x0001;
+const UINT16 SwDrawFirst = 0x0001;
+
+//---------------------------------------
+//SwFlyDrawObj, Die DrawObjekte fuer Flys.
+
+class SwFlyDrawObj : public SdrObject
+{
+ SfxItemSet* mpLocalItemSet;
+
+public:
+ TYPEINFO();
+
+ SwFlyDrawObj();
+ ~SwFlyDrawObj();
+
+
+ // ItemSet access
+
+ //Damit eine Instanz dieser Klasse beim laden erzeugt werden kann
+ //(per Factory).
+ virtual UINT32 GetObjInventor() const;
+ virtual UINT16 GetObjIdentifier() const;
+};
+
+//---------------------------------------
+//SwVirtFlyDrawObj, die virtuellen Objekte fuer Flys.
+//Flys werden immer mit virtuellen Objekten angezeigt. Nur so koennen sie
+//ggf. mehrfach angezeigt werden (Kopf-/Fusszeilen).
+
+class SwVirtFlyDrawObj : public SdrVirtObj
+{
+ SwFlyFrm *pFlyFrm;
+
+public:
+ TYPEINFO();
+
+ SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly);
+ ~SwVirtFlyDrawObj();
+
+ //Ueberladene Methoden der Basisklasse SdrVirtObj
+
+ //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand.
+ virtual const Rectangle& GetBoundRect() const;
+ virtual const Rectangle& GetSnapRect() const;
+
+ SwFrmFmt *GetFmt();
+
+ // Get Methoden fuer die Fly Verpointerung
+ SwFlyFrm* GetFlyFrm() { return pFlyFrm; }
+ const SwFlyFrm* GetFlyFrm() const { return pFlyFrm; }
+
+ void SetRect() const;
+ void _SetRectsDirty() { SetRectsDirty(); }
+
+ // ist eine URL an einer Grafik gesetzt, dann ist das ein Makro-Object
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/docfld.hxx b/binfilter/bf_sw/source/core/inc/docfld.hxx
new file mode 100644
index 000000000000..73bb8a0f5aab
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/docfld.hxx
@@ -0,0 +1,171 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _DOCFLD_HXX
+#define _DOCFLD_HXX
+
+#include <calc.hxx> // fuer SwHash
+#include <doc.hxx>
+namespace binfilter {
+
+class SwTxtFld;
+class SwIndex;
+class SwNodeIndex;
+class SwCntntNode;
+class SwCntntFrm;
+class SwSectionNode;
+class SwSection;
+class SwTxtTOXMark;
+class SwTableBox;
+class SwTxtINetFmt;
+class SwFlyFrmFmt;
+
+// Update an den Expression Feldern
+class _SetGetExpFld
+{
+ ULONG nNode;
+ xub_StrLen nCntnt;
+ union {
+ const SwTxtFld* pTxtFld;
+ const SwSection* pSection;
+ const SwPosition* pPos;
+ const SwTxtTOXMark* pTxtTOX;
+ const SwTableBox* pTBox;
+ const SwTxtINetFmt* pTxtINet;
+ const SwFlyFrmFmt* pFlyFmt;
+ } CNTNT;
+ enum _SetGetExpFldType
+ {
+ TEXTFIELD, TEXTTOXMARK, SECTIONNODE, CRSRPOS, TABLEBOX,
+ TEXTINET, FLYFRAME
+ } eSetGetExpFldType;
+
+public:
+ _SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld = 0,
+ const SwIndex* pIdx = 0 );
+
+ _SetGetExpFld( const SwSectionNode& rSectNode,
+ const SwPosition* pPos = 0 );
+
+ BOOL operator==( const _SetGetExpFld& rFld ) const
+ { return nNode == rFld.nNode && nCntnt == rFld.nCntnt &&
+ ( !CNTNT.pTxtFld || !rFld.CNTNT.pTxtFld ||
+ CNTNT.pTxtFld == rFld.CNTNT.pTxtFld ); }
+ BOOL operator<( const _SetGetExpFld& rFld ) const;
+
+ const SwTxtFld* GetFld() const
+ { return TEXTFIELD == eSetGetExpFldType ? CNTNT.pTxtFld : 0; }
+ const SwSection* GetSection() const
+ { return SECTIONNODE == eSetGetExpFldType ? CNTNT.pSection : 0; }
+ ULONG GetNode() const { return nNode; }
+ const void* GetPointer() const { return CNTNT.pTxtFld; }
+ const SwNode* GetNodeFromCntnt() const;
+ xub_StrLen GetCntPosFromCntnt() const;
+};
+
+typedef _SetGetExpFld* _SetGetExpFldPtr;
+SV_DECL_PTRARR_SORT_DEL( _SetGetExpFlds, _SetGetExpFldPtr, 0, 10 )
+
+
+// Struktur zum Speichern der Strings aus SetExp-String-Feldern
+struct _HashStr : public SwHash
+{
+ String aSetStr;
+ _HashStr( const String& rName, const String& rText, _HashStr* = 0 );
+};
+
+struct SwCalcFldType : public SwHash
+{
+ const SwFieldType* pFldType;
+
+ SwCalcFldType( const String& rStr, const SwFieldType* pFldTyp )
+ : SwHash( rStr ), pFldType( pFldTyp )
+ {}
+};
+
+// Suche nach dem String, der unter dem Namen in der HashTabelle abgelegt
+// wurde
+void LookString( SwHash** ppTbl, USHORT nSize, const String& rName,
+ String& rRet, USHORT* pPos = 0 );
+
+
+// --------
+
+const int GETFLD_ALL = 3; // veroderte Flags !!
+const int GETFLD_CALC = 1;
+const int GETFLD_EXPAND = 2;
+
+class SwDocUpdtFld
+{
+ _SetGetExpFlds* pFldSortLst; // akt. Field-Liste zum Calculieren
+ SwCalcFldType* aFldTypeTable[ TBLSZ ];
+
+// noch eine weitere Optimierung - wird z.Z. nicht angesprochen!
+ long nFldUpdtPos; // ab dieser Position mit Update starten
+ SwCntntNode* pCNode; // der TxtNode zur UpdatePos.
+
+ ULONG nNodes; // sollte die NodesAnzahl unterschiedlich sein
+ BYTE nFldLstGetMode;
+
+ BOOL bInUpdateFlds : 1; // zur Zeit laeuft ein UpdateFlds,
+ BOOL bFldsDirty : 1; // irgendwelche Felder sind ungueltig
+
+ void _MakeFldList( SwDoc& pDoc, int eGetMode );
+ void GetBodyNode( const SwTxtFld& , USHORT nFldWhich );
+ void GetBodyNode( const SwSectionNode&);
+public:
+ SwDocUpdtFld();
+ ~SwDocUpdtFld();
+
+ const _SetGetExpFlds* GetSortLst() const { return pFldSortLst; }
+
+ void MakeFldList( SwDoc& rDoc, int bAll, int eGetMode )
+ {
+ if( !pFldSortLst || bAll || !( eGetMode & nFldLstGetMode ) ||
+ rDoc.GetNodes().Count() != nNodes )
+ _MakeFldList( rDoc, eGetMode );
+ }
+
+ void InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld );
+
+ void InsertFldType( const SwFieldType& rType );
+
+ BOOL IsInUpdateFlds() const { return bInUpdateFlds; }
+ void SetInUpdateFlds( BOOL b ) { bInUpdateFlds = b; }
+
+ BOOL IsFieldsDirty() const { return bFldsDirty; }
+ void SetFieldsDirty( BOOL b ) { bFldsDirty = b; }
+
+ SwHash** GetFldTypeTable() const { return (SwHash**)aFldTypeTable; }
+};
+
+
+} //namespace binfilter
+#endif // _DOCFLD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/docfunc.hxx b/binfilter/bf_sw/source/core/inc/docfunc.hxx
new file mode 100644
index 000000000000..ab15a6b9402b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/docfunc.hxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _DOCFUNC_HXX
+#define _DOCFUNC_HXX
+
+
+// Diese Klasse wird von der Editshell benutz um fuer belibige
+// Doc-Aktionen ueber eine definierte Schnittstelle alle Cursor/
+// Bookmarks/usw. aus dem Loeschbereich zu verschieben, mit einem
+// anschliessenden Join-Node.
+// Das wird zur Zeit vom
+// - Delete
+// - Replace
+// benotigt.
+
+
+#include <tools/string.hxx>
+namespace binfilter {
+class SwPaM;
+
+enum DocFNType { DOC_DELETE, DOC_REPLACE };
+
+class SwCallDocFunction
+{
+ // Parameter fuers Replace (leider kein union moeglich; Str-Klasse !!)
+ const String aRplStr;
+ DocFNType eDocFnType;
+ BOOL bRplRegExp;
+
+public:
+ // fuer parameterlose Methoden
+ SwCallDocFunction( DocFNType eDocFn ) : eDocFnType( eDocFn ), aRplStr() {}
+ // fuer das Replace
+ SwCallDocFunction( const String& rStr, BOOL bFlag );
+
+ BOOL Call( SwPaM& );
+
+ // ALLE Methoden stehen im eddel.cxx !!
+};
+
+
+} //namespace binfilter
+#endif
+ //_DOCFUNC_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/doctxm.hxx b/binfilter/bf_sw/source/core/inc/doctxm.hxx
new file mode 100644
index 000000000000..7b67d76c70cb
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/doctxm.hxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _DOCTXM_HXX
+#define _DOCTXM_HXX
+
+
+#include <bf_svtools/svarray.hxx>
+#include <tools/gen.hxx>
+
+#include <tox.hxx>
+#include <section.hxx>
+class SvUShorts;
+class SvStringsDtor;
+class SvPtrarr;
+namespace binfilter {
+
+class SwTOXInternational;
+
+class SwTxtNode;
+class SwTxtFmtColl;
+struct SwPosition;
+struct SwTOXSortTabBase;
+
+typedef SwTOXSortTabBase* SwTOXSortTabBasePtr;
+
+SV_DECL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr, 0, 5 )//STRIP008 ;
+
+/*--------------------------------------------------------------------
+ Beschreibung: Ring der speziellen Verzeichnisse
+ --------------------------------------------------------------------*/
+
+class SwTOXBaseSection : public SwTOXBase, public SwSection
+{
+ SwTOXSortTabBases aSortArr;
+
+ void UpdateAll();
+
+ // Sortiert einfuegen ins Array fuer die Generierung
+
+ // Alpha-Trennzeichen bei der Generierung einfuegen
+
+ // Textrumpf generieren
+ // OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
+
+ // Seitennummerplatzhalter gegen aktuelle Nummern austauschen
+
+ // Bereich fuer Stichwort einfuegen suchen
+
+ // returne die TextCollection ueber den Namen / aus Format-Pool
+
+public:
+ SwTOXBaseSection( const SwTOXBase& rBase );
+ virtual ~SwTOXBaseSection();
+
+ // OD 19.03.2003 #106329# - add parameter <_bNewTOX> in order to distinguish
+ // between the creation of a new table-of-content or an update of
+ // a table-of-content. Default value: false
+ void Update( const SfxItemSet* pAttr = 0,
+ const bool _bNewTOX = false ); // Formatieren
+ void UpdatePageNum(); // Seitennummern einfuegen
+ TYPEINFO(); // fuers rtti
+
+};
+/* -----------------02.09.99 07:52-------------------
+
+ --------------------------------------------------*/
+struct SwDefTOXBase_Impl
+{
+ SwTOXBase* pContBase;
+ SwTOXBase* pIdxBase;
+ SwTOXBase* pUserBase;
+ SwTOXBase* pTblBase;
+ SwTOXBase* pObjBase;
+ SwTOXBase* pIllBase;
+ SwTOXBase* pAuthBase;
+
+ SwDefTOXBase_Impl() :
+ pContBase(0),
+ pIdxBase(0),
+ pUserBase(0),
+ pTblBase(0),
+ pObjBase(0),
+ pIllBase(0),
+ pAuthBase(0)
+ {}
+ ~SwDefTOXBase_Impl()
+ {
+ delete pContBase;
+ delete pIdxBase;
+ delete pUserBase;
+ delete pTblBase;
+ delete pObjBase;
+ delete pIllBase;
+ delete pAuthBase;
+ }
+
+};
+
+} //namespace binfilter
+#endif // _DOCTXM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/drawdev.hxx b/binfilter/bf_sw/source/core/inc/drawdev.hxx
new file mode 100644
index 000000000000..52720fcec81a
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/drawdev.hxx
@@ -0,0 +1,143 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _DRAWDEV_HXX
+#define _DRAWDEV_HXX
+
+#include "swrect.hxx"
+
+#include <vcl/outdev.hxx>
+namespace binfilter {
+
+/*************************************************************************
+ * class SwDrawDev
+ *
+ * Alle Draw-Methoden werden um den Offset *pPos verschoben.
+ *************************************************************************/
+
+class SwDrawDev
+{
+ OutputDevice *pOut;
+ const Point *pPos;
+
+public:
+ inline SwDrawDev( OutputDevice *pOut, const Point *pPos )
+ :pOut(pOut), pPos(pPos) { }
+
+ inline OutputDevice *GetOut() { return pOut; }
+
+ // Ausgabemethoden
+ inline void DrawText( const Point& rStart, const String& rTxt,
+ const USHORT nIdx = 0,
+ const USHORT nLen = STRING_LEN );
+ inline void DrawStretchText( const Point& rStart, USHORT nWidth,
+ const String& rTxt,
+ const USHORT nIdx = 0,
+ const USHORT nLen = STRING_LEN );
+ inline void DrawTextArray( const Point& rStart,
+ const String& rTxt,
+ long *pKernArray = 0,
+ const USHORT nIdx = 0,
+ const USHORT nLen = STRING_LEN);
+ inline void DrawLine( const Point& rStart, const Point& rEnd );
+ inline void DrawRect( const SwRect& rRect,
+ const USHORT nHorzRount = 0,
+ const USHORT nVertRound = 0 );
+
+ inline const Point *GetOrigin() const {return pPos; }
+};
+
+/*************************************************************************
+ * SwDrawDev::DrawText
+ *************************************************************************/
+
+inline void SwDrawDev::DrawText( const Point& rStart, const String& rTxt,
+ const USHORT nIdx, const USHORT nLen )
+{
+ if( !pPos )
+ pOut->DrawText( rStart, rTxt, nIdx, nLen );
+ else
+ pOut->DrawText( rStart - *pPos, rTxt, nIdx, nLen );
+}
+
+/*************************************************************************
+ * SwDrawDev::DrawStretchText
+ *************************************************************************/
+
+inline void SwDrawDev::DrawStretchText( const Point& rStart, USHORT nWidth,
+ const String& rTxt, const USHORT nIdx, const USHORT nLen )
+{
+ if( !pPos )
+ pOut->DrawStretchText( rStart, nWidth, rTxt, nIdx, nLen );
+ else
+ pOut->DrawStretchText( rStart - *pPos, nWidth, rTxt, nIdx, nLen );
+}
+
+/*************************************************************************
+ * SwDrawDev::DrawTextArray
+ *************************************************************************/
+
+inline void SwDrawDev::DrawTextArray( const Point& rStart, const String& rTxt,
+ long *pKernArray, const USHORT nIdx, const USHORT nLen )
+{
+ if( !pPos )
+ pOut->DrawTextArray( rStart, rTxt, pKernArray, nIdx, nLen );
+ else
+ pOut->DrawTextArray( rStart - *pPos, rTxt, pKernArray, nIdx, nLen );
+}
+
+/*************************************************************************
+ * SwDrawDev::DrawLine
+ *************************************************************************/
+
+inline void SwDrawDev::DrawLine( const Point& rStart, const Point& rEnd )
+{
+ if( !pPos )
+ pOut->DrawLine( rStart, rEnd );
+ else
+ pOut->DrawLine( rStart - *pPos, rEnd - *pPos );
+}
+
+/*************************************************************************
+ * SwDrawDev::DrawRect
+ *************************************************************************/
+
+inline void SwDrawDev::DrawRect( const SwRect& rRect,
+ const USHORT nHorzRound, const USHORT nVertRound )
+{
+ SwRect aRect( rRect );
+ if( pPos )
+ aRect.Pos() -= *pPos;
+ pOut->DrawRect( aRect.SVRect(), nHorzRound, nVertRound );
+}
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/drawfont.hxx b/binfilter/bf_sw/source/core/inc/drawfont.hxx
new file mode 100644
index 000000000000..d7f8d37ee121
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/drawfont.hxx
@@ -0,0 +1,767 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _DRAWFONT_HXX
+#define _DRAWFONT_HXX
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_SHORTS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_XUB_STRLEN
+#include <bf_svtools/svstdarr.hxx>
+#endif
+#include <tools/gen.hxx>
+#include <tools/string.hxx>
+#include "errhdl.hxx"
+#include <tools/fract.hxx>
+
+#include <i18npool/lang.h>
+class OutputDevice;
+class Point;
+class Size;
+class Font;
+namespace binfilter {
+
+class SwWrongList;
+class SwFont;
+
+class ViewShell;
+class SwTxtNode;
+class SwAttrHandler;
+class SwTxtFrm;
+class SwUnderlineFont;
+
+/*************************************************************************
+ * class SwScanner
+ * Hilfsklasse, die beim Spellen die Worte im gewuenschten Bereich
+ * nacheinander zur Verfuegung stellt.
+ *************************************************************************/
+
+class SwScanner
+{
+ XubString aWord;
+ const SwWrongList* pWrong;
+ const SwTxtNode& rNode;
+ xub_StrLen nEndPos;
+ xub_StrLen nBegin;
+ xub_StrLen nLen;
+ LanguageType aCurrLang;
+ USHORT nWordType;
+ BOOL bReverse;
+ BOOL bStart;
+ BOOL bIsOnlineSpell;
+
+public:
+ SwScanner( const SwTxtNode& rNd, const SwWrongList* pWrng, USHORT nWordType,
+ xub_StrLen nStart, xub_StrLen nEnde, BOOL bRev, BOOL bOS );
+
+ // This next word function tries to find the language for the next word
+ // It should currently _not_ be used for spell checking, and works only for
+ // ! bReverse
+ BOOL NextWord();
+
+ const XubString& GetWord() const { return aWord; }
+
+ xub_StrLen GetBegin() const { return nBegin; }
+ xub_StrLen GetEnd() const { return nBegin + nLen; }
+ xub_StrLen GetLen() const { return nLen; }
+};
+
+/*************************************************************************
+ * class SwScriptInfo
+ *
+ * encapsultes information about script changes
+ *************************************************************************/
+
+class SwScriptInfo
+{
+private:
+ SvXub_StrLens aScriptChg;
+ SvBytes aScriptType;
+ SvXub_StrLens aDirChg;
+ SvBytes aDirType;
+ SvXub_StrLens aKashida;
+ SvXub_StrLens aCompChg;
+ SvXub_StrLens aCompLen;
+ SvBytes aCompType;
+ xub_StrLen nInvalidityPos;
+ BYTE nDefaultDir;
+
+ void UpdateBidiInfo( const String& rTxt );
+
+public:
+ enum CompType { KANA, SPECIAL_LEFT, SPECIAL_RIGHT, NONE };
+
+ inline SwScriptInfo() : nInvalidityPos( 0 ), nDefaultDir( 0 ) {};
+
+ // determines script changes
+ void InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL );
+
+ // set/get position from which data is invalid
+ inline void SetInvalidity( const xub_StrLen nPos );
+ inline xub_StrLen GetInvalidity() const { return nInvalidityPos; };
+
+ // get default direction for paragraph
+ inline BYTE GetDefaultDir() const { return nDefaultDir; };
+
+ // array operations, nCnt refers to array position
+ inline USHORT CountScriptChg() const;
+ inline xub_StrLen GetScriptChg( const USHORT nCnt ) const;
+ inline BYTE GetScriptType( const USHORT nCnt ) const;
+
+ inline USHORT CountDirChg() const;
+ inline xub_StrLen GetDirChg( const USHORT nCnt ) const;
+ inline BYTE GetDirType( const USHORT nCnt ) const;
+
+ inline USHORT CountKashida() const;
+ inline xub_StrLen GetKashida( const USHORT nCnt ) const;
+
+ inline USHORT CountCompChg() const;
+ inline xub_StrLen GetCompStart( const USHORT nCnt ) const;
+ inline xub_StrLen GetCompLen( const USHORT nCnt ) const;
+ inline BYTE GetCompType( const USHORT nCnt ) const;
+
+ // "high" level operations, nPos refers to string position
+ xub_StrLen NextScriptChg( const xub_StrLen nPos ) const;
+ BYTE ScriptType( const xub_StrLen nPos ) const;
+
+ // Returns the position of the next direction level change.
+ // If bLevel is set, the position of the next level which is smaller
+ // than the level at position nPos is returned. This is required to
+ // obtain the end of a SwBidiPortion
+ xub_StrLen NextDirChg( const xub_StrLen nPos,
+ const BYTE* pLevel = 0 ) const;
+ BYTE DirType( const xub_StrLen nPos ) const;
+
+
+ // examines the range [ nStart, nStart + nEnd ] if there are kanas
+ // returns start index of kana entry in array, otherwise USHRT_MAX
+ USHORT HasKana( xub_StrLen nStart, const xub_StrLen nEnd ) const;
+
+ // modifies the kerning array according to a given compress value
+ long Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen nLen,
+ const USHORT nCompress, const USHORT nFontHeight,
+ Point* pPoint = NULL ) const;
+};
+
+inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
+{
+ if ( nPos < nInvalidityPos )
+ nInvalidityPos = nPos;
+};
+inline USHORT SwScriptInfo::CountScriptChg() const { return aScriptChg.Count(); }
+inline xub_StrLen SwScriptInfo::GetScriptChg( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aScriptChg.Count(),"No ScriptChange today!");
+ return aScriptChg[ nCnt ];
+}
+inline BYTE SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
+{
+ ASSERT( nCnt < aScriptChg.Count(),"No ScriptType today!");
+ return aScriptType[ nCnt ];
+}
+
+inline USHORT SwScriptInfo::CountDirChg() const { return aDirChg.Count(); }
+inline xub_StrLen SwScriptInfo::GetDirChg( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aDirChg.Count(),"No DirChange today!");
+ return aDirChg[ nCnt ];
+}
+inline BYTE SwScriptInfo::GetDirType( const xub_StrLen nCnt ) const
+{
+ ASSERT( nCnt < aDirChg.Count(),"No DirType today!");
+ return aDirType[ nCnt ];
+}
+
+inline USHORT SwScriptInfo::CountKashida() const { return aKashida.Count(); }
+inline xub_StrLen SwScriptInfo::GetKashida( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aKashida.Count(),"No Kashidas today!");
+ return aKashida[ nCnt ];
+}
+
+inline USHORT SwScriptInfo::CountCompChg() const { return aCompChg.Count(); };
+inline xub_StrLen SwScriptInfo::GetCompStart( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aCompChg.Count(),"No CompressionStart today!");
+ return aCompChg[ nCnt ];
+}
+inline xub_StrLen SwScriptInfo::GetCompLen( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aCompChg.Count(),"No CompressionLen today!");
+ return aCompLen[ nCnt ];
+}
+
+inline BYTE SwScriptInfo::GetCompType( const USHORT nCnt ) const
+{
+ ASSERT( nCnt < aCompChg.Count(),"No CompressionType today!");
+ return aCompType[ nCnt ];
+}
+
+/*************************************************************************
+ * class SwDrawTextInfo
+ *
+ * encapsulates information for drawing text
+ *************************************************************************/
+
+class SwDrawTextInfo
+{
+ const SwTxtFrm* pFrm;
+ OutputDevice* pOut;
+ ViewShell* pSh;
+ const SwScriptInfo* pScriptInfo;
+ const Point* pPos;
+ const XubString* pText;
+ const SwWrongList* pWrong;
+ const Size* pSize;
+ SwFont *pFnt;
+ SwUnderlineFont* pUnderFnt;
+ xub_StrLen* pHyphPos;
+// Fraction aZoom;
+ long nLeft;
+ long nRight;
+ long nKanaDiff;
+ xub_StrLen nIdx;
+ xub_StrLen nLen;
+ xub_StrLen nOfst;
+ USHORT nWidth;
+ USHORT nAscent;
+ USHORT nCompress;
+ short nSperren;
+ short nKern;
+ short nSpace;
+ BYTE nCursorBidiLevel;
+ BOOL bBullet : 1;
+ BOOL bUpper : 1; // Fuer Kapitaelchen: Grossbuchstaben-Flag
+ BOOL bDrawSpace : 1; // Fuer Kapitaelchen: Unter/Durchstreichung
+ BOOL bGreyWave : 1; // Graue Wellenlinie beim extended TextInput
+ BOOL bSpaceStop : 1; // For underlining we need to know, if a portion
+ // is right in front of a hole portion or a
+ // fix margin portion.
+ BOOL bSnapToGrid : 1; // Does paragraph snap to grid?
+ BOOL bIgnoreFrmRTL : 1; // Paint text as if text has LTR direction, used for
+ // line numbering
+ BOOL bPosMatchesBounds :1; // GetCrsrOfst should not return the next
+ // position if screen position is inside second
+ // have of bound rect, used for Accessibility
+
+ SwDrawTextInfo(); // nicht zulaessig
+public:
+#ifdef DBG_UTIL
+ BOOL bOut : 1; // In der Non-Product wird der Zugriff auf die Member
+ BOOL bPos : 1; // durch diese Flags ueberwacht.
+ BOOL bText : 1; // Wird ein Member gesetzt, so wird das entsprechende
+ BOOL bWrong : 1; // Flag gesetzt.
+ BOOL bSize : 1; // Wird ein Member ausgelesen, so wird ASSERTet, dass
+ BOOL bFnt : 1; // dieser zuvor gesetzt worden ist.
+ BOOL bIdx : 1;
+ BOOL bLen : 1;
+ BOOL bWidth : 1;
+ BOOL bAscent: 1;
+ BOOL bSperr : 1;
+ BOOL bKern : 1;
+ BOOL bSpace : 1;
+ BOOL bBull : 1;
+ BOOL bSpec : 1;
+ BOOL bUppr : 1;
+ BOOL bDrawSp: 1;
+ BOOL bGreyWv: 1;
+ BOOL bLeft : 1;
+ BOOL bRight : 1;
+ BOOL bKana : 1;
+ BOOL bOfst : 1;
+ BOOL bHyph : 1;
+#endif
+
+ SwDrawTextInfo( ViewShell *pS, OutputDevice &rO, const SwScriptInfo* pSI,
+ const XubString &rSt, xub_StrLen nI, xub_StrLen nL,
+ USHORT nW = 0, BOOL bB = FALSE )
+ {
+ pFrm = NULL;
+ pSh = pS;
+ pOut = &rO;
+ pScriptInfo = pSI;
+ pText = &rSt;
+ nIdx = nI;
+ nLen = nL;
+ nKern = 0;
+ nCompress = 0;
+ nWidth = nW;
+ nCursorBidiLevel = 0;
+ bBullet = bB;
+ pUnderFnt = 0;
+ bGreyWave = FALSE;
+ bSpaceStop = FALSE;
+ bSnapToGrid = FALSE;
+ bIgnoreFrmRTL = FALSE;
+ bPosMatchesBounds = FALSE;
+
+#ifdef DBG_UTIL
+ bOut = bText = bIdx = bLen = bWidth = bKern = bBull = bSpec =
+ bGreyWv = TRUE;
+
+ bPos = bWrong = bSize = bFnt = bAscent = bSpace = bUppr =
+ bDrawSp = bLeft = bRight = bKana = bOfst = bHyph = FALSE;
+#endif
+ }
+
+ const SwTxtFrm* GetFrm() const
+ {
+ return pFrm;
+ }
+
+ void SetFrm( const SwTxtFrm* pNewFrm )
+ {
+ pFrm = pNewFrm;
+ }
+
+ ViewShell *GetShell() const
+ {
+ return pSh;
+ }
+
+ OutputDevice& GetOut() const
+ {
+ ASSERT( bOut, "DrawTextInfo: Undefined Outputdevice" );
+ return *pOut;
+ }
+
+ OutputDevice *GetpOut() const
+ {
+ ASSERT( bOut, "DrawTextInfo: Undefined Outputdevice" );
+ return pOut;
+ }
+
+ const SwScriptInfo* GetScriptInfo() const
+ {
+ return pScriptInfo;
+ }
+
+ const Point &GetPos() const
+ {
+ ASSERT( bPos, "DrawTextInfo: Undefined Position" );
+ return *pPos;
+ }
+
+ xub_StrLen *GetHyphPos() const
+ {
+ ASSERT( bHyph, "DrawTextInfo: Undefined Hyph Position" );
+ return pHyphPos;
+ }
+
+ const XubString &GetText() const
+ {
+ ASSERT( bText, "DrawTextInfo: Undefined String" );
+ return *pText;
+ }
+
+ const SwWrongList* GetWrong() const
+ {
+ ASSERT( bWrong, "DrawTextInfo: Undefined WrongList" );
+ return pWrong;
+ }
+
+ const Size &GetSize() const
+ {
+ ASSERT( bSize, "DrawTextInfo: Undefined Size" );
+ return *pSize;
+ }
+
+ SwFont* GetFont() const
+ {
+ ASSERT( bFnt, "DrawTextInfo: Undefined Font" );
+ return pFnt;
+ }
+
+ SwUnderlineFont* GetUnderFnt() const
+ {
+ ASSERT( bSpec, "DrawTextInfo: Undefined Underlinefont" );
+ return pUnderFnt;
+ }
+
+ xub_StrLen GetIdx() const
+ {
+ ASSERT( bIdx, "DrawTextInfo: Undefined Index" );
+ return nIdx;
+ }
+
+ xub_StrLen GetLen() const
+ {
+ ASSERT( bLen, "DrawTextInfo: Undefined Length" );
+ return nLen;
+ }
+
+ xub_StrLen GetOfst() const
+ {
+ ASSERT( bOfst, "DrawTextInfo: Undefined Offset" );
+ return nOfst;
+ }
+
+ xub_StrLen GetEnd() const
+ {
+ ASSERT( bIdx, "DrawTextInfo: Undefined Index" );
+ ASSERT( bLen, "DrawTextInfo: Undefined Length" );
+ return nIdx + nLen;
+ }
+
+ long GetLeft() const
+ {
+ ASSERT( bLeft, "DrawTextInfo: Undefined left range" );
+ return nLeft;
+ }
+
+ long GetRight() const
+ {
+ ASSERT( bRight, "DrawTextInfo: Undefined right range" );
+ return nRight;
+ }
+
+ long GetKanaDiff() const
+ {
+ ASSERT( bKana, "DrawTextInfo: Undefined kana difference" );
+ return nKanaDiff;
+ }
+
+ USHORT GetWidth() const
+ {
+ ASSERT( bWidth, "DrawTextInfo: Undefined Width" );
+ return nWidth;
+ }
+
+ USHORT GetAscent() const
+ {
+ ASSERT( bAscent, "DrawTextInfo: Undefined Ascent" );
+ return nAscent;
+ }
+
+ USHORT GetKanaComp() const
+ {
+ return nCompress;
+ }
+
+ short GetSperren() const
+ {
+ ASSERT( bSperr, "DrawTextInfo: Undefined >Sperren<" );
+ return nSperren;
+ }
+
+ short GetKern() const
+ {
+ ASSERT( bKern, "DrawTextInfo: Undefined Kerning" );
+ return nKern;
+ }
+
+ short GetSpace() const
+ {
+ ASSERT( bSpace, "DrawTextInfo: Undefined Spacing" );
+ return nSpace;
+ }
+
+ BYTE GetCursorBidiLevel() const
+ {
+ return nCursorBidiLevel;
+ }
+
+ BOOL GetBullet() const
+ {
+ ASSERT( bBull, "DrawTextInfo: Undefined Bulletflag" );
+ return bBullet;
+ }
+
+ BOOL GetUpper() const
+ {
+ ASSERT( bUppr, "DrawTextInfo: Undefined Upperflag" );
+ return bUpper;
+ }
+
+ BOOL GetDrawSpace() const
+ {
+ ASSERT( bDrawSp, "DrawTextInfo: Undefined DrawSpaceflag" );
+ return bDrawSpace;
+ }
+
+ BOOL GetGreyWave() const
+ {
+ ASSERT( bGreyWv, "DrawTextInfo: Undefined GreyWave" );
+ return bGreyWave;
+ }
+
+ BOOL IsSpaceStop() const
+ {
+ return bSpaceStop;
+ }
+
+ BOOL SnapToGrid() const
+ {
+ return bSnapToGrid;
+ }
+
+ BOOL IsIgnoreFrmRTL() const
+ {
+ return bIgnoreFrmRTL;
+ }
+
+ BOOL IsPosMatchesBounds() const
+ {
+ return bPosMatchesBounds;
+ }
+
+ void SetOut( OutputDevice &rNew )
+ {
+ pOut = &rNew;
+#ifdef DBG_UTIL
+ bOut = TRUE;
+#endif
+ }
+
+ void SetPos( const Point &rNew )
+ {
+ pPos = &rNew;
+#ifdef DBG_UTIL
+ bPos = TRUE;
+#endif
+ }
+
+ void SetHyphPos( xub_StrLen *pNew )
+ {
+ pHyphPos = pNew;
+#ifdef DBG_UTIL
+ bHyph = TRUE;
+#endif
+ }
+
+ void SetText( const XubString &rNew )
+ {
+ pText = &rNew;
+#ifdef DBG_UTIL
+ bText = TRUE;
+#endif
+ }
+
+ void SetWrong( const SwWrongList* pNew )
+ {
+ pWrong = pNew;
+#ifdef DBG_UTIL
+ bWrong = TRUE;
+#endif
+ }
+
+ void SetSize( const Size &rNew )
+ {
+ pSize = &rNew;
+#ifdef DBG_UTIL
+ bSize = TRUE;
+#endif
+ }
+
+ void SetFont( SwFont* pNew )
+ {
+ pFnt = pNew;
+#ifdef DBG_UTIL
+ bFnt = TRUE;
+#endif
+ }
+
+ void SetIdx( xub_StrLen nNew )
+ {
+ nIdx = nNew;
+#ifdef DBG_UTIL
+ bIdx = TRUE;
+#endif
+ }
+
+ void SetLen( xub_StrLen nNew )
+ {
+ nLen = nNew;
+#ifdef DBG_UTIL
+ bLen = TRUE;
+#endif
+ }
+
+ void SetOfst( xub_StrLen nNew )
+ {
+ nOfst = nNew;
+#ifdef DBG_UTIL
+ bOfst = TRUE;
+#endif
+ }
+
+ void SetLeft( long nNew )
+ {
+ nLeft = nNew;
+#ifdef DBG_UTIL
+ bLeft = TRUE;
+#endif
+ }
+
+ void SetRight( long nNew )
+ {
+ nRight = nNew;
+#ifdef DBG_UTIL
+ bRight = TRUE;
+#endif
+ }
+
+ void SetKanaDiff( long nNew )
+ {
+ nKanaDiff = nNew;
+#ifdef DBG_UTIL
+ bKana = TRUE;
+#endif
+ }
+
+ void SetWidth( USHORT nNew )
+ {
+ nWidth = nNew;
+#ifdef DBG_UTIL
+ bWidth = TRUE;
+#endif
+ }
+
+ void SetAscent( USHORT nNew )
+ {
+ nAscent = nNew;
+#ifdef DBG_UTIL
+ bAscent = TRUE;
+#endif
+ }
+
+ void SetKern( short nNew )
+ {
+ nKern = nNew;
+#ifdef DBG_UTIL
+ bKern = TRUE;
+#endif
+ }
+
+ void SetSperren( short nNew )
+ {
+ nSperren = nNew;
+#ifdef DBG_UTIL
+ bSperr = TRUE;
+#endif
+ }
+
+ void SetSpace( short nNew )
+ {
+ if( nNew < 0 )
+ {
+ SetSperren( -nNew );
+ nSpace = 0;
+ }
+ else
+ {
+ nSpace = nNew;
+ SetSperren( 0 );
+ }
+#ifdef DBG_UTIL
+ bSpace = TRUE;
+#endif
+ }
+
+ void SetCursorBidiLevel( BYTE nNew )
+ {
+ nCursorBidiLevel = nNew;
+ }
+
+ void SetKanaComp( short nNew )
+ {
+ nCompress = nNew;
+ }
+
+ void SetBullet( BOOL bNew )
+ {
+ bBullet = bNew;
+#ifdef DBG_UTIL
+ bBull = TRUE;
+#endif
+ }
+
+ void SetUnderFnt( SwUnderlineFont* pFntIn )
+ {
+ pUnderFnt = pFntIn;
+#ifdef DBG_UTIL
+ bSpec = TRUE;
+#endif
+ }
+
+ void SetUpper( BOOL bNew )
+ {
+ bUpper = bNew;
+#ifdef DBG_UTIL
+ bUppr = TRUE;
+#endif
+ }
+
+ void SetDrawSpace( BOOL bNew )
+ {
+ bDrawSpace = bNew;
+#ifdef DBG_UTIL
+ bDrawSp = TRUE;
+#endif
+ }
+
+ void SetGreyWave( BOOL bNew )
+ {
+ bGreyWave = bNew;
+#ifdef DBG_UTIL
+ bGreyWv = TRUE;
+#endif
+ }
+
+ void SetSpaceStop( BOOL bNew )
+ {
+ bSpaceStop = bNew;
+ }
+
+ void SetSnapToGrid( BOOL bNew )
+ {
+ bSnapToGrid = bNew;
+ }
+
+ void SetIgnoreFrmRTL( BOOL bNew )
+ {
+ bIgnoreFrmRTL = bNew;
+ }
+
+ void SetPosMatchesBounds( BOOL bNew )
+ {
+ bPosMatchesBounds = bNew;
+ }
+
+
+ // sets a new color at the output device if necessary
+ // if a font is passed as argument, the change if made to the font
+ // otherwise the font at the output device is changed
+ // returns if the font has been changed
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/dview.hxx b/binfilter/bf_sw/source/core/inc/dview.hxx
new file mode 100644
index 000000000000..990a9b80a3c1
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/dview.hxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _DVIEW_HXX
+#define _DVIEW_HXX
+
+
+#include <bf_svx/fmview.hxx>
+class OutputDevice;
+namespace binfilter {
+
+
+class SwViewImp;
+
+class SwDrawView : public FmFormView
+{
+ //Fuer den Anker
+ Point aAnchorPoint; //Ankerposition
+ SwViewImp &rImp; //Die View gehoert immer zu einer Shell
+
+
+protected:
+ // add custom handles (used by other apps, e.g. AnchorPos)
+ virtual void AddCustomHdl();
+
+public:
+ SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice* pOutDev=NULL );
+
+ //aus der Basisklasse
+ virtual void MarkListHasChanged();
+
+ // #i7672#
+ // Overload to resue edit background color in active text edit view (OutlinerView)
+ virtual void ModelHasChanged();
+
+
+ const SwViewImp &Imp() const { return rImp; }
+ SwViewImp &Imp() { return rImp; }
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/flowfrm.hxx b/binfilter/bf_sw/source/core/inc/flowfrm.hxx
new file mode 100644
index 000000000000..eb95082218b4
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/flowfrm.hxx
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FLOWFRM_HXX
+#define _FLOWFRM_HXX
+
+#include <frmtool.hxx>
+
+namespace binfilter {
+
+//Der FlowFrm gibt die Funktionalitaet fuer alle Frms vor, die fliessen und
+//die sich aufspalten koennen (wie CntntFrm oder TabFrm).
+//Teile der Funktionalitaet sind im FlowFrm implementiert, andere Teile werden
+//von den spezifischen Frms implementiert.
+//Der FlowFrm ist kein eigenstaender Frm, es kann also auch niemals eine
+//eigenstaendige Instanz vom FlowFrm existieren.
+//Der FlowFrm ist nicht einmal ein echter Frm. Die naheliegende Implementierung
+//waere ein FlowFrm der virtual vom SwFrm abgeleitet ist und direkt auf den
+//eigenen Instanzdaten arbeitet. Abgeleitete Klassen muessten sich
+//vom FlowFrm und (ueber mehrere Basisklassen weil der Klassenbaum sich direkt
+//vom SwFrm zu SwCntntFrm und zum SwLayoutFrm spaltet) virtual vom SwFrm
+//ableiten.
+//Leider entstehen dadurch - neben Problemen mit Compilern und Debuggern -
+//erhebliche zusaetzliche Kosten, die wir uns heutzutage IMHO nicht erlauben
+//koennen.
+//Ich greife deshalb auf eine andere Technik zurueck: Der FlowFrm hat eine
+//Referenz auf den SwFrm - der er genau betrachtet selbst ist - und ist mit
+//diesem befreundet. So kann der FlowFrm anstelle des this-Pointer mit der
+//Referenz auf den SwFrm arbeiten.
+
+#include "frame.hxx" //fuer inlines
+
+class SwPageFrm;
+class SwRect;
+class SwBorderAttrs;
+class SwDoc;
+class SwNodeIndex;
+
+class SwFlowFrm
+{
+ //PrepareMake darf Locken/Unlocken (Robustheit)
+ friend inline void PrepareLock ( SwFlowFrm * );
+ friend inline void PrepareUnlock( SwFlowFrm * );
+
+ //TblSel darf das Follow-Bit zuruecksetzen.
+ friend inline void UnsetFollow( SwFlowFrm *pFlow );
+
+ friend void MakeFrms( SwDoc *, const SwNodeIndex &, const SwNodeIndex & );
+
+ friend class SwNode2LayImpl;
+
+ SwFrm &rThis;
+
+ //Hilfsfunktionen fuer MoveSubTree()
+ static SwLayoutFrm *CutTree( SwFrm* );
+ static BOOL PasteTree( SwFrm *, SwLayoutFrm *, SwFrm *, SwFrm* );
+
+ //Wird fuer das Zusammenspiel von _GetPrevxxx und MoveBwd gebraucht, damit
+ //mehrere Blaetter gleichzeitig uebersprungen werden koennen.
+ //Wird auch vom MoveBwd des TabFrm ausgewertet!
+ static BOOL bMoveBwdJump;
+
+protected:
+
+ SwFlowFrm *pFollow;
+
+ BOOL bIsFollow :1; //Ist's ein Follow
+ BOOL bLockJoin :1; //Join (und damit deleten) verboten wenn TRUE!
+ BOOL bUndersized:1; // wir sind kleiner als gewuenscht
+ BOOL bFtnAtEnd :1; // For sectionfrms only: footnotes at the end of section
+ BOOL bEndnAtEnd :1; // " " " : endnotes at the end of section
+ BOOL bCntntLock :1; // " " " : content locked
+ BOOL bOwnFtnNum :1; // " " " : special numbering of footnotes
+ BOOL bFtnLock :1; // " " " : ftn, don't leave this section bwd
+ BOOL bFlyLock :1; // Stop positioning of at-character flyframes
+
+ //Prueft ob Vorwaertsfluss noch Sinn macht Endloswanderschaften (unterbinden)
+ inline BOOL IsFwdMoveAllowed();
+ BOOL IsKeepFwdMoveAllowed(); //Wie oben, Move fuer Keep.
+
+ //Prueft ob ein Obj das Umlauf wuenscht ueberlappt.
+ //eine Null bedeutet, kein Objekt ueberlappt,
+ // 1 heisst, Objekte, die am FlowFrm selbst verankert sind, ueberlappen
+ // 2 heisst, Objekte, die woanders verankert sind, ueberlappen
+ // 3 heistt, beiderlei verankerte Objekte ueberlappen
+ BYTE BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect );
+
+ void LockJoin() { bLockJoin = TRUE; }
+ void UnlockJoin() { bLockJoin = FALSE; }
+
+ BOOL CheckMoveFwd( BOOL &rbMakePage, BOOL bKeep, BOOL bMovedBwd );
+ BOOL MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways = FALSE );
+ virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat )=0;
+ BOOL MoveBwd( BOOL &rbReformat );
+
+ BOOL IsKeep( const SwBorderAttrs &rAttrs ) const; //Ist ein Keep zu beruecksichtigen (Breaks!)
+
+public:
+ SwFlowFrm( SwFrm &rFrm );
+
+ const SwFrm *GetFrm() const { return &rThis; }
+ SwFrm *GetFrm() { return &rThis; }
+
+ static BOOL IsMoveBwdJump() { return bMoveBwdJump; }
+ static void SetMoveBwdJump( BOOL bNew ){ bMoveBwdJump = bNew; }
+
+ inline void SetUndersized( const BOOL bNew ) { bUndersized = bNew; }
+ inline BOOL IsUndersized() const { return bUndersized; }
+
+ BOOL IsPrevObjMove() const;
+
+ //Die Kette mit minimalen Operationen und Benachrichtigungen unter den
+ //neuen Parent Moven.
+ void MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling = 0 );
+
+ BOOL HasFollow() const { return pFollow ? TRUE : FALSE; }
+ BOOL IsFollow() const { return bIsFollow; }
+ inline void _SetIsFollow( BOOL bSet ) { bIsFollow = bSet; }
+ const SwFlowFrm *GetFollow() const { return pFollow; }
+ SwFlowFrm *GetFollow() { return pFollow; }
+ BOOL IsAnFollow( const SwFlowFrm *pFlow ) const;
+ inline void SetFollow( SwFlowFrm *pNew ) { pFollow = pNew; }
+ SwFlowFrm *FindMaster();
+ inline const SwFlowFrm *FindMaster() const;
+
+ sal_Bool IsJoinLocked() const { return bLockJoin; }
+ sal_Bool IsAnyJoinLocked() const { return bLockJoin || HasLockedFollow(); }
+ BOOL IsFtnAtEnd() const { return bFtnAtEnd; }
+ BOOL IsEndnAtEnd() const { return bEndnAtEnd; }
+ BOOL IsAnyNoteAtEnd() const { return bFtnAtEnd || bEndnAtEnd; }
+ BOOL AreNotesAtEnd() const { return bFtnAtEnd && bEndnAtEnd; }
+
+ BOOL IsPageBreak( BOOL bAct ) const;
+ BOOL IsColBreak( BOOL bAct ) const;
+ sal_Bool HasLockedFollow() const;
+
+ SwTwips CalcUpperSpace( const SwBorderAttrs *pAttrs = NULL,
+ const SwFrm* pPr = NULL ) const;
+
+ void CheckKeep();
+
+ void SetFtnLock( BOOL bNew ){ bFtnLock = bNew; }
+ BOOL IsFtnLock() const { return bFtnLock; }
+ void SetFlyLock( BOOL bNew ){ bFlyLock = bNew; }
+ BOOL IsFlyLock() const { return bFlyLock; }
+ void SetOwnFtnNum( BOOL bNew ){ bOwnFtnNum = bNew; }
+ BOOL IsOwnFtnNum() const { return bOwnFtnNum; }
+ void SetCntntLock( BOOL bNew ){ bCntntLock = bNew; }
+ BOOL IsCntntLocked() const { return bCntntLock; }
+
+ //casten einen Frm auf einen FlowFrm - wenns denn einer ist, sonst 0
+ //Diese Methoden muessen fuer neue Ableitungen geaendert werden!
+ static SwFlowFrm *CastFlowFrm( SwFrm *pFrm );
+ static const SwFlowFrm *CastFlowFrm( const SwFrm *pFrm );
+};
+
+inline const SwFlowFrm *SwFlowFrm::FindMaster() const
+{
+ return ((SwFlowFrm*)this)->FindMaster();
+}
+inline BOOL SwFlowFrm::IsFwdMoveAllowed()
+{
+ return rThis.GetIndPrev() != 0;
+}
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/flyfrm.hxx b/binfilter/bf_sw/source/core/inc/flyfrm.hxx
new file mode 100644
index 000000000000..f0db77e8fc8b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/flyfrm.hxx
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FLYFRM_HXX
+#define _FLYFRM_HXX
+
+#include "layfrm.hxx"
+#include <orntenum.hxx>
+
+class PolyPolygon;
+namespace binfilter {
+class SwPageFrm;
+class SwFlyFrmFmt;
+class SwFmtFrmSize;
+struct SwCrsrMoveState;
+class SwBorderAttrs;
+class SwVirtFlyDrawObj;
+class SwSpzFrmFmts;
+class SwAttrSetChg;
+
+
+
+//Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen.
+//Wird beim Draggen von Absatzgebundenen Objekten zur Ankeranzeige sowie
+//fuer Ankerwechsel benoetigt.
+//implementiert in layout/flycnt.cxx
+const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
+ const BOOL bBody = FALSE );
+
+// berechnet das Rechteck, in dem das Objekt bewegt bzw. resized werden darf
+BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove = TRUE );
+
+//allg. Basisklasse fuer alle Freifliegenden Rahmen
+class SwFlyFrm : public SwLayoutFrm
+{
+ //darf Locken. Definiert in frmtool.cxx
+ friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * );
+ friend void AppendAllObjs( const SwSpzFrmFmts * );
+ friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld );
+ //darf die Pos berechnen (lassen)
+ friend void lcl_MakeFlyPosition( SwFlyFrm *pFly );
+
+ void InitDrawObj( BOOL bNotify ); //Wird von den CToren gerufen.
+ void FinitDrawObj(); //Wird vom CTor gerufen.
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+
+protected:
+
+ SwVirtFlyDrawObj *pDrawObj; // das Drawingobject zum Fly
+ SwFrm *pAnchor; // An diesem LayoutFrm haengt der Frm, kann 0 sein
+
+ SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
+ *pNextLink; // Textfluss
+
+ Point aRelPos; //Die Relative Position zum Master
+
+private:
+ BOOL bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
+ //koennen, dass sie nicht Formatiert werden; :MakeAll
+ //returnt dann sofort. Dies ist bei Seitenwechseln
+ //waehrend der Formatierung notwendig.
+ //Auch wahrend des RootCTors ist dies notwendig da
+ //sonst der Anker formatiert wird obwohl die Root noch
+ //nicht korrekt an der Shell haengt und weil sonst
+ //initial zuviel Formatiert wuerde.
+ BOOL bNotifyBack:1; //TRUE wenn am Ende eines MakeAll() der Background
+ //vom NotifyDTor benachrichtigt werden muss.
+protected:
+
+ BOOL bInvalid :1; //Pos, PrtArea od. SSize wurden Invalidiert, sie werden
+ //gleich wieder Validiert, denn sie muessen _immer_
+ //gueltig sein. Damit in LayAction korrekt gearbeitet
+ //werden kann muss hier festgehalten werden, dass sie
+ //invalidiert wurden. Ausnahmen bestaetigen die Regelt!
+ BOOL bMinHeight:1; //TRUE wenn die vom Attribut vorgegebene Hoehe eine
+ //eine Minimalhoehe ist (der Frm also bei Bedarf
+ //darueberhinaus wachsen kann).
+ BOOL bHeightClipped :1; //TRUE wenn der Fly nicht die Pos/Size anhand der Attrs
+ BOOL bWidthClipped :1; //formatieren konnte, weil z.B. nicht genug Raum vorh.
+ //war.
+ BOOL bFormatHeightOnly :1; //Damit nach einer Anpassung der Breite
+ //(CheckClip) nur das Format aufgerufen wird;
+ //nicht aber die Breite anhand der Attribute
+ //wieder bestimmt wird.
+ BOOL bInCnt :1; // FLY_IN_CNTNT, als Zeichen verankert
+ BOOL bAtCnt :1; // FLY_AT_CNTNT, am Absatz verankert
+ BOOL bLayout :1; // FLY_PAGE, FLY_AT_FLY, an Seite oder Rahmen
+ BOOL bAutoPosition :1; // FLY_AUTO_CNTNT, im Text verankerter Rahmen
+ BOOL bNoShrink :1; // temporary forbud of shrinking to avoid loops
+
+ friend class SwNoTxtFrm; // Darf NotifyBackground rufen
+ virtual void NotifyBackground( SwPageFrm *pPage,
+ const SwRect& rRect, PrepareHint eHint) = 0;
+
+ //Wird nur von SwXFrm::MakeAll() gerufen; wer es anders macht wird
+ //in einen Sack gesteckt und muss zwei Tage drin hocken bleiben.
+ virtual void MakeFlyPos();
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ void MakePrtArea( const SwBorderAttrs &rAttrs );
+
+ void Lock() { bLocked = TRUE; }
+ void Unlock() { bLocked = FALSE; }
+
+ void SetMinHeight() { bMinHeight = TRUE; }
+ void ResetMinHeight(){ bMinHeight = FALSE; }
+
+ Size CalcRel( const SwFmtFrmSize &rSz ) const;
+
+ SwFlyFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+public:
+
+ virtual ~SwFlyFrm();
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ // erfrage vom Client Informationen
+ virtual BOOL GetInfo( SfxPoolItem& ) const;
+ virtual void ChgSize( const Size& aNewSize );
+
+ virtual void Cut();
+#ifdef DBG_UTIL
+#endif
+
+ SwTwips _Shrink( SwTwips, SZPTR BOOL bTst );
+ SwTwips _Grow ( SwTwips, SZPTR BOOL bTst );
+ void _Invalidate( SwPageFrm *pPage = 0 );
+
+ BOOL FrmSizeChg( const SwFmtFrmSize & );
+
+ const SwFrm *GetAnchor() const { return pAnchor; }
+ SwFrm *GetAnchor() { return pAnchor; }
+ void ChgAnchor( SwFrm *pNew ) { pAnchor = pNew; }
+
+ SwFlyFrm *GetPrevLink() { return pPrevLink; }
+ SwFlyFrm *GetNextLink() { return pNextLink; }
+
+
+
+ const SwVirtFlyDrawObj *GetVirtDrawObj() const { return pDrawObj; }
+ SwVirtFlyDrawObj *GetVirtDrawObj() { return pDrawObj; }
+ void NotifyDrawObj();
+
+ const Point& GetCurRelPos() const { return aRelPos; }
+ BOOL IsInvalid() const { return bInvalid; }
+ void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = TRUE; }
+ void Validate() const { ((SwFlyFrm*)this)->bInvalid = FALSE; }
+
+ BOOL IsMinHeight() const { return bMinHeight; }
+ BOOL IsLocked() const { return bLocked; }
+ BOOL IsAutoPos() const { return bAutoPosition; }
+ BOOL IsFlyInCntFrm() const { return bInCnt; }
+ BOOL IsFlyFreeFrm() const { return bAtCnt || bLayout; }
+ BOOL IsFlyLayFrm() const { return bLayout; }
+ BOOL IsFlyAtCntFrm() const { return bAtCnt; }
+
+ BOOL IsNotifyBack() const { return bNotifyBack; }
+ void SetNotifyBack() { bNotifyBack = TRUE; }
+ void ResetNotifyBack() { bNotifyBack = FALSE; }
+ BOOL IsNoShrink() const { return bNoShrink; }
+ void SetNoShrink( BOOL bNew ) { bNoShrink = bNew; }
+
+ BOOL IsClipped() const { return bHeightClipped || bWidthClipped; }
+ BOOL IsHeightClipped() const { return bHeightClipped; }
+ BOOL IsWidthClipped() const { return bWidthClipped; }
+
+ BOOL IsLowerOf( const SwLayoutFrm *pUpper ) const;
+ inline BOOL IsUpperOf( const SwFlyFrm *pLower ) const;
+
+
+ SwRect AddSpacesToFrm() const;
+
+ // OD 16.04.2003 #i13147# - add parameter <_bForPaint> to avoid load of
+ // the graphic during paint. Default value: sal_False
+ BOOL GetContour( PolyPolygon& rContour,
+ const sal_Bool _bForPaint = sal_False ) const;
+
+ BOOL ConvertHoriTo40( SwHoriOrient &rHori, SwRelationOrient &rRel, SwTwips &rPos ) const;
+
+ //Auf dieser Shell painten (PreView, Print-Flag usw. rekursiv beachten)?.
+
+ /** SwFlyFrm::IsBackgroundTransparent - for feature #99657#
+
+ OD 12.08.2002
+ determines, if background of fly frame has to be drawn transparent
+ definition found in /core/layout/paintfrm.cxx
+
+ @author OD
+
+ @return true, if background color is transparent or a existing background
+ graphic is transparent.
+ */
+ sal_Bool IsBackgroundTransparent() const;
+};
+
+inline BOOL SwFlyFrm::IsUpperOf( const SwFlyFrm *pLower ) const
+{
+ return pLower->IsLowerOf( this );
+}
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/flyfrms.hxx b/binfilter/bf_sw/source/core/inc/flyfrms.hxx
new file mode 100644
index 000000000000..08a8355c7b07
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/flyfrms.hxx
@@ -0,0 +1,169 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FLYFRMS_HXX
+#define _FLYFRMS_HXX
+
+#include "flyfrm.hxx"
+namespace binfilter {
+
+//Basisklasse fuer diejenigen Flys, die sich relativ frei Bewegen koennen -
+//also die nicht _im_ Inhalt gebundenen Flys.
+class SwFlyFreeFrm : public SwFlyFrm
+{
+ SwPageFrm *pPage; //Bei dieser Seite ist der Fly angemeldet.
+
+ void CheckClip( const SwFmtFrmSize &rSz ); //'Emergency' Clipping.
+
+protected:
+ virtual void NotifyBackground( SwPageFrm *pPage,
+ const SwRect& rRect, PrepareHint eHint);
+
+
+ SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+public:
+
+ virtual ~SwFlyFreeFrm();
+
+ virtual void MakeAll();
+
+ SwPageFrm *GetPage() { return pPage; }
+ const SwPageFrm *GetPage() const { return pPage; }
+ void SetPage( SwPageFrm *pNew ) { pPage = pNew; }
+};
+
+
+//Die Fly's, die an einem Layoutfrm haengen und nicht inhaltsgebunden sind
+class SwFlyLayFrm : public SwFlyFreeFrm
+{
+public:
+ SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyLayFrm( SwFlyLayFrm& );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+};
+
+//Die Flys, die an einem Cntnt haengen nicht aber im Inhalt
+class SwFlyAtCntFrm : public SwFlyFreeFrm
+{
+ SwRect aLastCharRect; // Fuer autopositionierte Frames ( LAYER_IMPL )
+protected:
+ //Stellt sicher, das der Fly an der richtigen Seite haengt.
+ void AssertPage();
+
+ virtual void MakeAll();
+ virtual void MakeFlyPos();
+public:
+ SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+
+ // Fuer autopositionierte Frames ( LAYER_IMPL ), ueberprueft, ob sich
+ // die Ankerposition geaendert hat und invalidiert ggf.
+
+ SwTwips GetLastCharX() const { return aLastCharRect.Left() - Frm().Left(); }
+
+ SwTwips GetRelCharX( const SwFrm* pFrm ) const
+ { return aLastCharRect.Left() - pFrm->Frm().Left(); }
+ SwTwips GetRelCharY( const SwFrm* pFrm ) const
+ { return aLastCharRect.Bottom() - pFrm->Frm().Top(); }
+
+ void AddLastCharY( long nDiff ){ aLastCharRect.Pos().Y() += nDiff; }
+};
+
+//Die Flys, die an einem Zeichen in einem Cntnt haengen.
+class SwFlyInCntFrm : public SwFlyFrm
+{
+ Point aRef; //Relativ zu diesem Point wird die AbsPos berechnet.
+ long nLine; //Zeilenhoehe, Ref.Y() - nLine == Zeilenanfang.
+
+ BOOL bInvalidLayout :1;
+ BOOL bInvalidCntnt :1;
+
+ virtual void MakeFlyPos();
+
+protected:
+ virtual void NotifyBackground( SwPageFrm *pPage,
+ const SwRect& rRect, PrepareHint eHint);
+ virtual void MakeAll();
+
+public:
+ SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+
+ virtual ~SwFlyInCntFrm();
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
+ const Point &rRelPos );
+ const Point &GetRefPoint() const { return aRef; }
+ const Point &GetRelPos() const;
+ long GetLineHeight() const { return nLine; }
+
+ inline void InvalidateLayout() const;
+ inline void InvalidateCntnt() const;
+ inline void ValidateLayout() const;
+ inline void ValidateCntnt() const;
+ BOOL IsInvalid() const { return (bInvalidLayout || bInvalidCntnt); }
+ BOOL IsInvalidLayout() const { return bInvalidLayout; }
+ BOOL IsInvalidCntnt() const { return bInvalidCntnt; }
+
+
+ //BP 26.11.93: vgl. tabfrm.hxx, gilt bestimmt aber fuer andere auch...
+ //Zum Anmelden der Flys nachdem ein FlyCnt erzeugt _und_ eingefuegt wurde.
+ //Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird
+ //Das Teil gepastet; mithin ist auch erst dann die Seite zum Anmelden der
+ //Flys erreichbar.
+ void RegistFlys();
+
+ //siehe layact.cxx
+ void AddRefOfst( long nOfst ) { aRef.Y() += nOfst; }
+};
+
+inline void SwFlyInCntFrm::InvalidateLayout() const
+{
+ ((SwFlyInCntFrm*)this)->bInvalidLayout = TRUE;
+}
+inline void SwFlyInCntFrm::InvalidateCntnt() const
+{
+ ((SwFlyInCntFrm*)this)->bInvalidCntnt = TRUE;
+}
+inline void SwFlyInCntFrm::ValidateLayout() const
+{
+ ((SwFlyInCntFrm*)this)->bInvalidLayout = FALSE;
+}
+inline void SwFlyInCntFrm::ValidateCntnt() const
+{
+ ((SwFlyInCntFrm*)this)->bInvalidCntnt = FALSE;
+}
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/fntcache.hxx b/binfilter/bf_sw/source/core/inc/fntcache.hxx
new file mode 100644
index 000000000000..baa1c9ecc773
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/fntcache.hxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FNTCACHE_HXX
+#define _FNTCACHE_HXX
+
+
+#include <vcl/font.hxx>
+#include <tools/mempool.hxx>
+
+#include "swtypes.hxx"
+#include "swcache.hxx"
+/*N*/ #include <tools/debug.hxx> //for stripping
+class Printer;
+class OutputDevice;
+class FontMetric;
+namespace binfilter {
+
+class SwFntObj;
+class SwDrawTextInfo; // DrawText
+class SwScriptInfo;
+class ViewShell;
+class SwSubFont;
+
+/*************************************************************************
+ * class SwFntCache
+ *************************************************************************/
+
+class SwFntCache : public SwCache
+{
+public:
+
+ inline SwFntCache() : SwCache(50,50
+#ifdef DBG_UTIL
+ , ByteString( RTL_CONSTASCII_STRINGPARAM(
+ "Globaler Font-Cache pFntCache" ))
+#endif
+ ) {}
+
+ inline SwFntObj *First( ) { return (SwFntObj *)SwCache::First(); }
+ inline SwFntObj *Next( SwFntObj *pFntObj)
+ { return (SwFntObj *)SwCache::Next( (SwCacheObj *)pFntObj ); }
+ void Flush();
+};
+
+// Font-Cache, globale Variable, in txtinit.Cxx angelegt/zerstoert
+extern SwFntCache *pFntCache;
+extern SwFntObj *pLastFont;
+extern BYTE *pMagicNo;
+extern Color *pWaveCol;
+
+/*************************************************************************
+ * class SwFntObj
+ *************************************************************************/
+
+class SwFntObj : public SwCacheObj
+{
+ friend class SwFntAccess;
+ friend void _InitCore();
+ friend void _FinitCore();
+
+ Font aFont;
+ Font *pScrFont;
+ Font *pPrtFont;
+ OutputDevice* pPrinter;
+ USHORT nLeading;
+ USHORT nScrAscent;
+ USHORT nPrtAscent;
+ USHORT nScrHeight;
+ USHORT nPrtHeight;
+ USHORT nPropWidth;
+ USHORT nZoom;
+ BOOL bSymbol : 1;
+ BOOL bPaintBlank : 1;
+ void ChooseFont( ViewShell *pSh, OutputDevice *pOut );
+
+ static long nPixWidth;
+ static MapMode *pPixMap;
+ static OutputDevice *pPixOut;
+
+public:
+ DECL_FIXEDMEMPOOL_NEWDEL(SwFntObj)
+
+ SwFntObj( const SwSubFont &rFont, const void* pOwner,
+ ViewShell *pSh );
+
+ virtual ~SwFntObj();
+
+ inline Font *GetScrFont() { return pScrFont; }
+ inline Font *GetFont() { return &aFont; }
+ inline const Font *GetFont() const { return &aFont; }
+
+ inline USHORT GetLeading() const { return nLeading; }
+
+ void GuessLeading( const ViewShell *pSh, const FontMetric& rMet );
+ USHORT GetAscent( const ViewShell *pSh, const OutputDevice *pOut );
+ USHORT GetHeight( const ViewShell *pSh, const OutputDevice *pOut );
+
+ void SetDevFont( const ViewShell *pSh, OutputDevice *pOut );
+ inline OutputDevice* GetPrt() const { return pPrinter; }
+ inline USHORT GetZoom() const { return nZoom; }
+ inline USHORT GetPropWidth() const { return nPropWidth; }
+ inline BOOL IsSymbol() const { return bSymbol; }
+
+ Size GetTextSize( SwDrawTextInfo &rInf );
+
+ void CreateScrFont( const ViewShell *pSh, const OutputDevice& rOut );
+ void CreatePrtFont( const OutputDevice& rOut );
+};
+
+/*************************************************************************
+ * class SwFntAccess
+ *************************************************************************/
+
+
+class SwFntAccess : public SwCacheAccess
+{
+ ViewShell *pShell;
+protected:
+ virtual SwCacheObj *NewObj( );
+
+public:
+ SwFntAccess( const void * &rMagic, USHORT &rIndex, const void *pOwner,
+ ViewShell *pShell,
+ BOOL bCheck = FALSE );
+ inline SwFntObj* Get() { return (SwFntObj*) SwCacheAccess::Get(); };
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/frame.hxx b/binfilter/bf_sw/source/core/inc/frame.hxx
new file mode 100644
index 000000000000..69269f4dd1f0
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/frame.hxx
@@ -0,0 +1,1093 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FRAME_HXX
+#define _FRAME_HXX
+
+#include <bf_svtools/svarray.hxx>
+#include "swtypes.hxx" // fuer SwTwips
+#include "swrect.hxx"
+#include "calbck.hxx" // fuer SwClient
+#include <tools/debug.hxx>
+
+#define SZPTR
+#define PHEIGHT
+#define PWIDTH
+#define BFIXHEIGHT bFixSize
+#define PTPTR PointPtr
+#define SIZEPTR SizePtr
+typedef long Size::* SizePtr;
+typedef long Point::* PointPtr;
+class Brush;
+class Color;
+
+namespace binfilter {
+class SfxPoolItem;
+
+class SwLayoutFrm;
+class SwRootFrm;
+class SwPageFrm;
+class SwFlyFrm;
+class SwSectionFrm;
+class SdrObject;
+class SwDrawContact;
+class SwFtnFrm;
+class SwFtnBossFrm;
+class SwTabFrm;
+class SwFlowFrm;
+class SwCntntFrm;
+
+class SwAttrSet;
+class ViewShell;
+class SwBorderAttrs;
+class SwCache;
+class SvxBrushItem;
+class SwTxtFtn;
+struct SwPosition;
+struct SwCrsrMoveState;
+// OD 20.05.2003 #108784#
+class SwDrawVirtObj;
+
+//Jeder FrmTyp findet sich hier in einem Bit wieder.
+//Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
+//werden kann was fuer ein FrmTyp eine Instanz ist _und_ von welchen Klassen
+//sie abgeleitet ist.
+//Der Frm hat in der Basisklasse einen Member der von den CToren der
+//einzelnen Frms entsprechend gesetzt werden muss.
+#define FRM_ROOT 0x0001
+#define FRM_PAGE 0x0002
+#define FRM_COLUMN 0x0004
+#define FRM_HEADER 0x0008
+#define FRM_FOOTER 0x0010
+#define FRM_FTNCONT 0x0020
+#define FRM_FTN 0x0040
+#define FRM_BODY 0x0080
+#define FRM_FLY 0x0100
+#define FRM_SECTION 0x0200
+#define FRM_UNUSED 0x0400
+#define FRM_TAB 0x0800
+#define FRM_ROW 0x1000
+#define FRM_CELL 0x2000
+#define FRM_TXT 0x4000
+#define FRM_NOTXT 0x8000
+
+//Fuer den internen Gebrauch ein paar gebraeuchliche Verknuepfungen.
+#define FRM_LAYOUT 0x3FFF
+#define FRM_CNTNT 0xC000
+#define FRM_FTNBOSS 0x0006
+#ifdef ACCESSIBLE_LAYOUT
+#define FRM_ACCESSIBLE (FRM_HEADER|FRM_FOOTER|FRM_FTN|FRM_TXT|FRM_ROOT|FRM_FLY|FRM_TAB|FRM_CELL|FRM_PAGE)
+#endif
+
+ //Weils so schon ist das ganze als Bitfeld....
+//0000 0000 0000 0001 ROOT
+//0000 0000 0000 0010 PAGE
+//0000 0000 0000 0100 COLUMN
+//0000 0000 0000 1000 HEADER
+//0000 0000 0001 0000 FOOTER
+//0000 0000 0010 0000 FTNCONT
+//0000 0000 0100 0000 FTN
+//0000 0000 1000 0000 BODY
+//0000 0001 0000 0000 FLY
+//0000 0010 0000 0000 SECTION
+//0000 0100 0000 0000 UNUSED
+//0000 1000 0000 0000 TAB
+//0001 0000 0000 0000 ROW
+//0010 0000 0000 0000 CELL
+//0100 0000 0000 0000 TXT
+//1000 0000 0000 0000 NOTXT
+
+// The type of the frame is internal represented by the 4-bit value nType,
+// which can expanded to the types above by shifting a bit (0x1 << nType)
+// Here are the corresponding defines for the compressed representation:
+
+#define FRMC_ROOT 0
+#define FRMC_PAGE 1
+#define FRMC_COLUMN 2
+#define FRMC_HEADER 3
+#define FRMC_FOOTER 4
+#define FRMC_FTNCONT 5
+#define FRMC_FTN 6
+#define FRMC_BODY 7
+#define FRMC_FLY 8
+#define FRMC_SECTION 9
+#define FRMC_UNUSED 10
+#define FRMC_TAB 11
+#define FRMC_ROW 12
+#define FRMC_CELL 13
+#define FRMC_TXT 14
+#define FRMC_NOTXT 15
+
+#define FRM_NEIGHBOUR 0x2004
+#define FRM_NOTE_VERT 0x5a60
+#define FRM_HEADFOOT 0x0018
+#define FRM_BODYFTNC 0x00a0
+
+class SwFrm;
+typedef long (SwFrm:: *SwFrmGet)() const;
+typedef BOOL (SwFrm:: *SwFrmMax)( long );
+typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, BOOL );
+typedef long (*SwOperator)( long, long );
+typedef void (SwFrm:: *SwFrmSet)( long, long );
+
+struct SwRectFnCollection
+{
+ SwRectGet fnGetTop;
+ SwRectGet fnGetBottom;
+ SwRectGet fnGetLeft;
+ SwRectGet fnGetRight;
+ SwRectGet fnGetWidth;
+ SwRectGet fnGetHeight;
+ SwRectPoint fnGetPos;
+ SwRectSize fnGetSize;
+
+ SwRectSet fnSetTop;
+ SwRectSet fnSetBottom;
+ SwRectSet fnSetLeft;
+ SwRectSet fnSetRight;
+ SwRectSet fnSetWidth;
+ SwRectSet fnSetHeight;
+
+ SwRectSet fnSubTop;
+ SwRectSet fnAddBottom;
+ SwRectSet fnSubLeft;
+ SwRectSet fnAddRight;
+ SwRectSet fnAddWidth;
+ SwRectSet fnAddHeight;
+
+ SwRectSet fnSetPosX;
+ SwRectSet fnSetPosY;
+
+ SwFrmGet fnGetTopMargin;
+ SwFrmGet fnGetBottomMargin;
+ SwFrmGet fnGetLeftMargin;
+ SwFrmGet fnGetRightMargin;
+ SwFrmSet fnSetXMargins;
+ SwFrmSet fnSetYMargins;
+ SwFrmGet fnGetPrtTop;
+ SwFrmGet fnGetPrtBottom;
+ SwFrmGet fnGetPrtLeft;
+ SwFrmGet fnGetPrtRight;
+ SwRectDist fnTopDist;
+ SwRectDist fnBottomDist;
+ SwRectDist fnLeftDist;
+ SwRectDist fnRightDist;
+ SwFrmMax fnSetLimit;
+ SwRectMax fnOverStep;
+
+ SwRectSetPos fnSetPos;
+ SwFrmMakePos fnMakePos;
+ SwOperator fnXDiff;
+ SwOperator fnYDiff;
+ SwOperator fnXInc;
+ SwOperator fnYInc;
+
+ SwRectSetTwice fnSetLeftAndWidth;
+ SwRectSetTwice fnSetTopAndHeight;
+};
+
+typedef SwRectFnCollection* SwRectFn;
+extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
+
+#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bRev = pFrm->IsReverse(); \
+ SwRectFn fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : fnRectVert ): \
+ ( bRev ? fnRectB2T : fnRectHori );
+#define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
+ sal_Bool bRevX = pFrm->IsReverse(); \
+ SwRectFn fnRectX = bVertX ? \
+ ( bRevX ? fnRectVL2R : fnRectVert ): \
+ ( bRevX ? fnRectB2T : fnRectHori );
+#define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
+ bRev != pFrm->IsReverse() ) \
+ bVert = pFrm->IsVertical(); \
+ bRev = pFrm->IsReverse(); \
+ fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : fnRectVert ): \
+ ( bRev ? fnRectB2T : fnRectHori ); }
+#define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
+ SwRectFn fnRect = bVert == bNeighb ? \
+ fnRectHori : fnRectVert;
+#define POS_DIFF( aFrm1, aFrm2 ) \
+ ( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
+ (aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
+
+
+//fuer Prepare() zur Benachrichtigung des Inhaltes durch das Layout auf
+//dem kurzen Dienstweg.
+//Der Inhalt sorgt dafuer, dass beim naechsten Aufruf von ::Format() das
+//minimal notwendige berechnet wird.
+enum PrepareHint
+{
+ PREP_BEGIN, //BEGIN
+ PREP_CLEAR = PREP_BEGIN,//Komplett neuformatieren.
+ PREP_WIDOWS_ORPHANS, //Nur Witwen- und Waisen-Regelung pruefen und ggf.
+ //Aufspalten.
+ PREP_FIXSIZE_CHG, //Die FixSize hat sich veraendert.
+ PREP_FOLLOW_FOLLOWS, //Follow ist jetzt moeglicherweise direkter
+ //Nachbar.
+ PREP_ADJUST_FRM, //Groesse per Grow/Shrink Ausrichten ohne zu
+ //Formatieren.
+ PREP_FLY_CHGD, //Ein FlyFrm hat sich (Groesse) veraendert.
+ PREP_FLY_ATTR_CHG, //Ein FlyFrm hat seine Attribute veraendert
+ //(z.B. Umlauf)
+ PREP_FLY_ARRIVE, //Ein FlyFrm ueberlappt den Bereich jetzt neu.
+ PREP_FLY_LEAVE, //Ein FlyFrm hat den Bereich verlassen.
+ PREP_FTN, //Fussnoten-Invalidierung
+ PREP_POS_CHGD, //Position des Frm hat sich verandert
+ //(Zum Fly-Umbruch pruefen). Im void* des Prepare()
+ //wird ein BOOL& uebergeben, dieser zeigt mit TRUE,
+ //dass ein Format ausgefuehrt wurde.
+ PREP_UL_SPACE, //UL-Space hat sich veraendert, TxtFrms muessen
+ //den Zeilenabstand neu kalkulieren.
+ PREP_MUST_FIT, //Frm passen machen (aufspalten) auch wenn die
+ //Attribute es nicht erlauben (z.B. zusammenhalten).
+ PREP_WIDOWS, // Ein Follow stellt fest, dass in ihm die Orphans-
+ // regel zuschlaegt und verschickt an seinen
+ // Vorgaenger (Master/Follow) ein PREP_WIDOWS
+ PREP_QUOVADIS, // Wenn eine Fussnote _zwischen_ zwei Absaetzen
+ // aufgespalten werden muss, dann muss der
+ // letzte auf der Seite noch ein QUOVADIS bekommen
+ // damit er den Text hineinformatiert.
+ PREP_BOSS_CHGD, // Wenn ein Frm die Spalte/Seite wechselt, wird dieses
+ // Zusatzprepare zum POS_CHGD im MoveFwd/Bwd
+ // verschickt (Ftn-Nummern joinen etc.)
+ // Die Richtung wird ueber pVoid mitgeteilt:
+ // MoveFwd: pVoid == 0
+ // MoveBwd: pVoid == pOldPage
+ PREP_SWAP, //Grafiken Swappen, fuer Grafiken im sichtbaren
+ //Bereich.
+ PREP_REGISTER, //Registerhaltige Frames invalidieren
+ PREP_FTN_GONE, //Ein Follow verliert eine Fussnote, ggf. kann seine erste
+ //Zeile hochrutschen
+ PREP_MOVEFTN, //eine Fussnote wechselt die Seite, der Inhalt bekommt
+ //zunaechst eine Hoehe von Null, damit nicht zuviel
+ //Unruhe entsteht. Beim Formatieren prueft er, ob er
+ //ueberhaupt passt und wechselt ggf. unbemerkt wieder
+ //die Seite.
+ PREP_ERGOSUM, //wg. Bewegung in FtnFrms QuoVadis/ErgoSum pruefen
+ PREP_END //END
+};
+
+//Fuer GetNextLeaf/GetPrevLeaf.
+enum MakePageType
+{
+ MAKEPAGE_NONE, //Keine Seite bzw. Fussnote anlegen
+ MAKEPAGE_APPEND, //Nur ggf. Seite anhaengen
+ MAKEPAGE_INSERT, //Seite ggf. anhaengen oder einfuegen.
+ MAKEPAGE_FTN, //Fussnote ggf. einfuegen.
+ MAKEPAGE_NOSECTION // Don't create section frames
+};
+
+typedef SdrObject* SdrObjectPtr;
+SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1)//STRIP008 ;
+
+class SwFrm: public SwClient
+{
+ //Der verkappte Frm
+ friend class SwFlowFrm;
+ friend class SwLayoutFrm; // Sw3FrameIo: fuer pNext, pPrev
+ friend class SwLooping; // LoopControlling (layouter.cxx)
+
+ //Hebt die Lower waehrend eines Spaltenumbaus auf.
+ friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
+ friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling );
+
+ //Checkt ob sich beim MakePos die Pos des Frm aendert oder nicht
+ //layact.cxx
+ friend BOOL CheckPos( SwFrm *pFrm );
+
+ //entfernt leere SwSectionFrms aus einer Kette
+ friend SwFrm* SwClearDummies( SwFrm* pFrm );
+
+ //Zum validieren eines unsinnig invalidierten in SwCntntFrm::MakeAll
+ friend void ValidateSz( SwFrm *pFrm );
+ // Implementiert in text/txtftn.cxx, verhindert Ftn-Oszillation
+ friend void ValidateTxt( SwFrm *pFrm );
+
+// friend void CalcAnchorAndKeep( SwFlyFrm * );
+
+ friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt );
+
+ //Cache fuer (Umrandungs-)Attribute.
+ static SwCache *pCache;
+
+#ifdef DBG_UTIL
+ //Nur zu Debugging Zwecken! eindeutige Nummerierung aller Frames,
+ //verwaltet in den CToren.
+ static USHORT nLastFrmId;
+ const USHORT nFrmId;
+#endif
+
+ SwLayoutFrm *pUpper;
+ SwFrm *pNext;
+ SwFrm *pPrev;
+
+ //Schatten und Umrandung painten
+ SwFrm *_FindNext();
+ SwFrm *_FindPrev();
+ SwCntntFrm *_FindNextCnt();
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE & );
+ SwFrm* _GetIndPrev();
+ SwFrm* _GetIndNext();
+ void SetDirFlags( BOOL bVert );
+
+ SwFrm( SwFrm & ); //Kopieren ist nicht erlaubt.
+
+ SwCntntFrm* ImplGetNextCntntFrm() const;
+ SwCntntFrm* ImplGetPrevCntntFrm() const;
+
+protected:
+ SwDrawObjs *pDrawObjs; //Hier haengen die DrawObjs, kann 0 sein
+
+ SwRect aFrm; //Absolute Dokumentposition und groesse des Frm
+ SwRect aPrt; //Position der PrtArea rel zum Frm und groesse der PrtArea
+
+ USHORT bFlag01: 1;
+ USHORT bFlag02: 1;
+ USHORT bFlag03: 1;
+ USHORT bFlag04: 1;
+ USHORT bFlag05: 1;
+ USHORT bReverse: 1; // Next line above/at the right side instead
+ // under/at the left side of the previous line.
+ USHORT bInvalidR2L: 1;
+ USHORT bDerivedR2L: 1;
+ USHORT bRightToLeft: 1;
+ USHORT bInvalidVert: 1;
+ USHORT bDerivedVert: 1;
+ USHORT bVertical: 1;
+ USHORT nType: 4; //Who am I?
+
+ BOOL bValidPos: 1;
+ BOOL bValidPrtArea: 1;
+ BOOL bValidSize: 1;
+ BOOL bValidLineNum: 1;
+ BOOL bFixSize: 1;
+ BOOL bUnUsed1: 1;
+ BOOL bCompletePaint: 1; //Frame wird ganz gepaintet wenn TRUE, auch
+ //wenn der Inhalt nur teilw. veraendert ist;
+ //Bei CntntFrms wird ausschliesslich wenn TRUE
+ //der Border (von Action) gemalt.
+ BOOL bRetouche: 1; //Der Frame ist fuer Retusche verantwortlich
+ //wenn TRUE.
+public:
+ BOOL bUnUsed2: 1;
+protected:
+ BOOL bInfInvalid: 1; //InfoFlags sind Invalid.
+ BOOL bInfBody: 1; //Frm steht im DokumentBody.
+ BOOL bInfTab: 1; //Frm steht in einer Tabelle.
+ BOOL bInfFly: 1; //Frm steht in einem Fly.
+ BOOL bInfFtn: 1; //Frm steht in einer Fussnote.
+ BOOL bInfSct: 1; //Frm steht in einem Bereich.
+ BOOL bColLocked: 1; //Grow/Shrink sperren bei spaltigen Section-
+ //oder Fly-Frames, wird im Format gesetzt
+
+ void ColLock() { bColLocked = TRUE; }
+ void ColUnlock() { bColLocked = FALSE; }
+
+ SwPageFrm *InsertPage( SwPageFrm *pSibling, BOOL bFtn );
+ void PrepareMake();
+ void OptPrepareMake();
+ void MakePos();
+ virtual void MakeAll() = 0;
+ //Adjustierung der Frames einer Seite
+ SwTwips AdjustNeighbourhood( SwTwips nDiff, BOOL bTst = FALSE );
+
+
+ //Aendern nur die Framesize, nicht die PrtArea-SSize
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
+
+ SwModify *GetDep() { return pRegisteredIn; }
+ const SwModify *GetDep() const { return pRegisteredIn; }
+
+ SwFrm( SwModify* );
+
+ void CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse );
+public:
+ TYPEINFO(); //Bereits in Basisklasse Client drin.
+
+ USHORT GetType() const { return 0x1 << nType; }
+
+ static SwCache &GetCache() { return *pCache; }
+ static SwCache *GetCachePtr() { return pCache; }
+ static void SetCache( SwCache *pNew ) { pCache = pNew; }
+
+ //Aendern die PrtArea-SSize und die FrmSize.
+ SwTwips Shrink( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ SwTwips Grow ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+
+ //Wir brauchen unterschiedliche Methoden (wg. Performance) fuer das
+ //Einfuegenin den Layout Baum:
+
+ //Einfuegen vor pBehind oder am Ende der Kette unter pUpper
+ void InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind );
+ //Einfuegen hinter pBefore oder am Anfang der Kette unter pUpper
+ void InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore );
+ //Einfuegen vor pBehind oder am Ende der Kette, unter Beruecksichtigung
+ //der Geschwister von pSct
+ void Remove();
+
+ //For internal use only; wer es anders macht wird
+ //in einen Sack gesteckt und muss zwei Tage drin hocken bleiben.
+ //Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch (Tabellen).
+ SwLayoutFrm *GetLeaf( MakePageType eMakePage, BOOL bFwd );
+ SwLayoutFrm *GetNextLeaf ( MakePageType eMakePage );
+ SwLayoutFrm *GetNextSctLeaf( MakePageType eMakePage );
+ SwLayoutFrm *GetPrevLeaf ( MakePageType eMakeFtn = MAKEPAGE_FTN );
+ SwLayoutFrm *GetPrevSctLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
+ const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, BOOL bFwd,
+ const SwFrm *pAnch ) const;
+ BOOL WrongPageDesc( SwPageFrm* pNew );
+
+ void AppendDrawObj( SwDrawContact *pObj );
+ void RemoveDrawObj( SwDrawContact *pToRemove );
+ // OD 20.05.2003 #108784# - <AppendDrawObj>/<RemoveDrawObj> for virtual drawing objects
+ void AppendVirtDrawObj( SwDrawContact* _pDrawContact,
+ SwDrawVirtObj* _pDrawVirtObj );
+ void RemoveVirtDrawObj( SwDrawContact* _pDrawContact,
+ SwDrawVirtObj* _pDrawVirtObj );
+
+ //Arbeiten mit der Kette der FlyFrms
+ void AppendFly( SwFlyFrm *pNew );
+ void RemoveFly( SwFlyFrm *pToRemove );
+ const SwDrawObjs *GetDrawObjs() const { return pDrawObjs; }
+ SwDrawObjs *GetDrawObjs() { return pDrawObjs; }
+ void CalcFlys( BOOL bInvaPosOnly );
+
+
+ //Retouche, nicht im Bereich des uebergebenen Rect!
+
+
+ inline void SetCompletePaint() const;
+ inline void ResetCompletePaint() const;
+ inline BOOL IsCompletePaint() const { return bCompletePaint; }
+
+ inline void SetRetouche() const;
+ inline void ResetRetouche() const;
+ inline BOOL IsRetouche() const { return bRetouche; }
+
+ void SetInfFlags(); //Setzen der InfoFlags
+ inline void InvalidateInfFlags() { bInfInvalid = TRUE; }
+ inline BOOL IsInDocBody() const; //Benutzen die InfoFlags.
+ inline BOOL IsInFtn() const; //ggf. werden die Flags ermittelt.
+ inline BOOL IsInTab() const;
+ inline BOOL IsInFly() const;
+ inline BOOL IsInSct() const;
+ inline BOOL IsReverse() const { return bReverse; }
+ inline void SetReverse( BOOL bNew ){ bReverse = bNew ? 1 : 0; }
+ inline BOOL IsVertical() const;
+ inline BOOL GetVerticalFlag() const;
+ inline void SetVertical( BOOL bNew ){ bVertical = bNew ? 1 : 0; }
+ inline void SetDerivedVert( BOOL bNew ){ bDerivedVert = bNew ? 1 : 0; }
+ inline void SetInvalidVert( BOOL bNew) { bInvalidVert = bNew ? 1 : 0; }
+ inline BOOL IsRightToLeft() const;
+ inline BOOL GetRightToLeftFlag() const;
+ inline void SetRightToLeft( BOOL bNew ){ bRightToLeft = bNew ? 1 : 0; }
+ inline void SetDerivedR2L( BOOL bNew ) { bDerivedR2L = bNew ? 1 : 0; }
+ inline void SetInvalidR2L( BOOL bNew ) { bInvalidR2L = bNew ? 1 : 0; }
+ void CheckDirChange();
+ // returns upper left frame position for LTR and
+ // upper right frame position for Asian / RTL frames
+ Point GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const;
+ BOOL IsMoveable() const;
+
+ //Ist es fuer den (Txt)Frm in der aktuellen Umgebung erlaubt eine
+ //Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
+ BOOL IsFtnAllowed() const;
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 ){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+
+ virtual void CheckDirection( BOOL bVert );
+
+ void ReinitializeFrmSizeAttrFlags();
+
+ const SwAttrSet *GetAttrSet() const;
+ SwAttrSet *GetAttrSet();
+ void GetAttrSet( SwAttrSet* );
+
+ inline BOOL HasFixSize() const { return bFixSize; }
+
+ //Kann 0 liefern, pruefen auch ob die Shell zum richtigen Dokument
+ //gehoert. Impl in frmsh.hxx
+ inline ViewShell *GetShell() const;
+
+ //Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
+ static void CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields = TRUE );
+
+ //Koennen 0 liefern, einmal const einmal nicht
+ SwFrm *GetNext() { return pNext; }
+ SwFrm *GetPrev() { return pPrev; }
+ SwLayoutFrm *GetUpper() { return pUpper; }
+ SwRootFrm *FindRootFrm();
+ SwPageFrm *FindPageFrm();
+ SwFrm *FindColFrm();
+ SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE );
+ SwTabFrm *ImplFindTabFrm();
+ SwFtnFrm *ImplFindFtnFrm();
+ SwFlyFrm *ImplFindFlyFrm();
+ SwSectionFrm *ImplFindSctFrm();
+ SwFrm *FindFooterOrHeader();
+ SwFrm *GetLower();
+ const SwFrm *GetNext() const { return pNext; }
+ const SwFrm *GetPrev() const { return pPrev; }
+ const SwLayoutFrm *GetUpper() const { return pUpper; }
+ inline SwTabFrm *FindTabFrm();
+ inline SwFtnFrm *FindFtnFrm();
+ inline SwFlyFrm *FindFlyFrm();
+ inline SwSectionFrm *FindSctFrm();
+ inline SwFrm *FindNext();
+ inline SwCntntFrm *FindNextCnt();
+ inline SwFrm *FindPrev();
+ inline const SwPageFrm *FindPageFrm() const;
+ inline const SwRootFrm *FindRootFrm() const;
+ inline const SwFtnBossFrm *FindFtnBossFrm( BOOL bFtn = FALSE ) const;
+ inline const SwFrm *FindColFrm() const;
+ inline const SwFrm *FindFooterOrHeader() const;
+ inline const SwTabFrm *FindTabFrm() const;
+ inline const SwFtnFrm *FindFtnFrm() const;
+ inline const SwFlyFrm *FindFlyFrm() const;
+ inline const SwSectionFrm *FindSctFrm() const;
+ inline const SwFrm *FindNext() const;
+ inline const SwCntntFrm *FindNextCnt() const;
+ inline const SwFrm *FindPrev() const;
+ const SwFrm *GetLower() const;
+
+ SwFrm* GetIndPrev()
+ { return ( pPrev || !IsInSct() ) ? pPrev : _GetIndPrev(); }
+ const SwFrm* GetIndPrev() const { return ((SwFrm*)this)->GetIndPrev(); }
+ SwFrm* GetIndNext()
+ { return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
+ const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
+
+ USHORT GetPhyPageNum() const; //Seitennummer ohne Offset
+ USHORT GetVirtPageNum() const; //Seitenummer mit Offset
+ BOOL OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
+ BOOL WannaRightPage() const;
+
+ const SwLayoutFrm *GetPrevLayoutLeaf() const;
+ const SwLayoutFrm *GetNextLayoutLeaf() const;
+ inline SwLayoutFrm *GetPrevLayoutLeaf();
+ inline SwLayoutFrm *GetNextLayoutLeaf();
+
+ inline void Calc() const; //Hier wird ggf. 'Formatiert'
+ inline void OptCalc() const; //Hier wird zur Optimierung davon ausgegangen,
+ //das die Vorgaenger bereits formatiert sind.
+
+ inline Point GetRelPos() const;
+ const SwRect &Frm() const { return aFrm; }
+ const SwRect &Prt() const { return aPrt; }
+
+ // The PaintArea is the area, where content may be displayed.
+ // The margin of the page or the space between columns belongs to her.
+ const SwRect PaintArea() const;
+ // The UnionFrm is the union of frm- and prt-area, normally identical
+ // to the frm-area except the case of negative prt-margins.
+ const SwRect UnionFrm( BOOL bBorder = FALSE ) const;
+
+ //Der Zugriff auf die Member wird hier ausnahmsweiste gestattet,
+ //dies soll aber nicht dazu dienen die Werte wahllos zu veraendern;
+ //es ist nur die einzige Moeglichkeit die Compilerprobleme zu umgehen
+ //(gleiche Methode mal public mal protected).
+ SwRect &Frm() { return aFrm; }
+ SwRect &Prt() { return aPrt; }
+
+ virtual void ChgSize( const Size& aNewSize );
+
+ virtual void Cut() = 0;
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
+
+ void ValidateLineNum() { bValidLineNum = TRUE; }
+
+ BOOL GetValidPosFlag() const { return bValidPos; }
+ BOOL GetValidPrtAreaFlag()const { return bValidPrtArea; }
+ BOOL GetValidSizeFlag() const { return bValidSize; }
+ BOOL GetValidLineNumFlag()const { return bValidLineNum; }
+ BOOL IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
+
+ //Invalideren nur den Frm
+ void _InvalidateSize() { bValidSize = FALSE; }
+ void _InvalidatePrt() { bValidPrtArea = FALSE; }
+ void _InvalidatePos() { bValidPos = FALSE; }
+ void _InvalidateLineNum() { bValidLineNum = FALSE; }
+ void _InvalidateAll() { bValidSize = bValidPrtArea = bValidPos = FALSE; }
+
+ //Benachrichtigen gleich die Seite mit.
+ inline void InvalidateSize();
+ inline void InvalidatePrt();
+ inline void InvalidatePos();
+ inline void InvalidateLineNum();
+ inline void InvalidateAll();
+ void ImplInvalidateSize();
+ void ImplInvalidatePrt();
+ void ImplInvalidatePos();
+ void ImplInvalidateLineNum();
+
+ inline void InvalidateNextPos( BOOL bNoFtn = FALSE );
+ void ImplInvalidateNextPos( BOOL bNoFtn = FALSE );
+ void InvalidatePage( const SwPageFrm *pPage = 0 ) const;
+
+ virtual BOOL GetCrsrOfst( SwPosition *, Point&,
+ const SwCrsrMoveState* = 0 ) const{DBG_BF_ASSERT(0, "STRIP"); return FALSE;} //STRIP001 const SwCrsrMoveState* = 0 ) const;
+ virtual BOOL GetCharRect( SwRect &, const SwPosition&,
+ SwCrsrMoveState* = 0 ) const;
+
+ // der "kurze Dienstweg" zwischen den Frames und der Formatierung.
+ // Wer den void* falsch Casted ist selbst schuld!
+ // Auf jedenfall muss der void* auf 0 geprueft werden.
+ virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
+ const void *pVoid = 0, BOOL bNotify = TRUE );
+
+ //TRUE wenn's die richtige Klasse ist, FALSE sonst
+ inline BOOL IsLayoutFrm() const;
+ inline BOOL IsRootFrm() const;
+ inline BOOL IsPageFrm() const;
+ inline BOOL IsColumnFrm() const;
+ inline BOOL IsFtnBossFrm() const; // Fussnotenbosse sind PageFrms und ColumnFrms
+ inline BOOL IsHeaderFrm() const;
+ inline BOOL IsFooterFrm() const;
+ inline BOOL IsFtnContFrm() const;
+ inline BOOL IsFtnFrm() const;
+ inline BOOL IsBodyFrm() const;
+ inline BOOL IsColBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb ColumnFrm
+ inline BOOL IsPageBodyFrm() const; // in layfrm.hxx implementiert, BodyFrm unterhalb PageFrm
+ inline BOOL IsFlyFrm() const;
+ inline BOOL IsSctFrm() const;
+ inline BOOL IsTabFrm() const;
+ inline BOOL IsRowFrm() const;
+ inline BOOL IsCellFrm() const;
+ inline BOOL IsCntntFrm() const;
+ inline BOOL IsTxtFrm() const;
+ inline BOOL IsNoTxtFrm() const;
+ inline BOOL IsFlowFrm() const; //Frms deren PrtArea von den Nachbarn
+ //abhaengen und die halt im Inhaltsfluss
+ //stehen.
+ inline BOOL IsRetoucheFrm() const; //Frms die Retouchefaehig sind bzw. die
+ //u.U. hinter sich Retouchieren muessen.
+#ifdef ACCESSIBLE_LAYOUT
+ inline BOOL IsAccessibleFrm() const;
+#endif
+
+
+ //Ist der Frm (bzw. die Section in der er steht) geschuetzt?
+ //Auch Fly in Fly in ... und Fussnoten
+ BOOL IsProtected() const;
+
+ BOOL IsColLocked() const { return bColLocked; }
+
+ virtual ~SwFrm();
+
+ // No inline cause we need the function pointers
+ long GetTopMargin() const;
+ long GetBottomMargin() const;
+ long GetLeftMargin() const;
+ long GetRightMargin() const;
+ void SetTopBottomMargins( long, long );
+ void SetBottomTopMargins( long, long );
+ void SetLeftRightMargins( long, long );
+ void SetRightLeftMargins( long, long );
+ void SetLeftAndWidth( long nLeft, long nWidth );
+ void SetTopAndHeight( long nTop, long nHeight );
+ void SetRightAndWidth( long nRight, long nWidth );
+ void SetBottomAndHeight( long nBottom, long nHeight );
+ long GetPrtLeft() const;
+ long GetPrtBottom() const;
+ long GetPrtRight() const;
+ long GetPrtTop() const;
+ BOOL SetMinLeft( long );
+ BOOL SetMaxBottom( long );
+ BOOL SetMaxRight( long );
+ BOOL SetMinTop( long );
+ void MakeBelowPos( const SwFrm*, const SwFrm*, BOOL );
+ void MakeUpperPos( const SwFrm*, const SwFrm*, BOOL );
+ void MakeLeftPos( const SwFrm*, const SwFrm*, BOOL );
+ void MakeRightPos( const SwFrm*, const SwFrm*, BOOL );
+ inline BOOL IsNeighbourFrm() const
+ { return GetType() & FRM_NEIGHBOUR ? TRUE : FALSE; }
+
+ inline SwCntntFrm* GetNextCntntFrm() const;
+ inline SwCntntFrm* GetPrevCntntFrm() const;
+
+#ifdef DBG_UTIL
+ inline USHORT GetFrmId() const { return nFrmId; }
+ inline USHORT GetLastFrmId() const { return nLastFrmId; }
+#endif
+};
+
+inline BOOL SwFrm::IsInDocBody() const
+{
+ if ( bInfInvalid )
+ ((SwFrm*)this)->SetInfFlags();
+ return bInfBody;
+}
+inline BOOL SwFrm::IsInFtn() const
+{
+ if ( bInfInvalid )
+ ((SwFrm*)this)->SetInfFlags();
+ return bInfFtn;
+}
+inline BOOL SwFrm::IsInTab() const
+{
+ if ( bInfInvalid )
+ ((SwFrm*)this)->SetInfFlags();
+ return bInfTab;
+}
+inline BOOL SwFrm::IsInFly() const
+{
+ if ( bInfInvalid )
+ ((SwFrm*)this)->SetInfFlags();
+ return bInfFly;
+}
+inline BOOL SwFrm::IsInSct() const
+{
+ if ( bInfInvalid )
+ ((SwFrm*)this)->SetInfFlags();
+ return bInfSct;
+}
+BOOL SwFrm::IsVertical() const
+{
+ if( bInvalidVert )
+ ((SwFrm*)this)->SetDirFlags( TRUE );
+ return bVertical != 0;
+}
+BOOL SwFrm::GetVerticalFlag() const
+{
+ return bVertical != 0;
+}
+inline BOOL SwFrm::IsRightToLeft() const
+{
+ if( bInvalidR2L )
+ ((SwFrm*)this)->SetDirFlags( FALSE );
+ return bRightToLeft != 0;
+}
+BOOL SwFrm::GetRightToLeftFlag() const
+{
+ return bRightToLeft != 0;
+}
+
+inline void SwFrm::SetCompletePaint() const
+{
+ ((SwFrm*)this)->bCompletePaint = TRUE;
+}
+inline void SwFrm::ResetCompletePaint() const
+{
+ ((SwFrm*)this)->bCompletePaint = FALSE;
+}
+
+inline void SwFrm::SetRetouche() const
+{
+ ((SwFrm*)this)->bRetouche = TRUE;
+}
+inline void SwFrm::ResetRetouche() const
+{
+ ((SwFrm*)this)->bRetouche = FALSE;
+}
+
+inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
+{
+ return (SwLayoutFrm*)((const SwFrm*)this)->GetPrevLayoutLeaf();
+}
+inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
+{
+ return (SwLayoutFrm*)((const SwFrm*)this)->GetNextLayoutLeaf();
+}
+
+inline void SwFrm::InvalidateSize()
+{
+ if ( bValidSize )
+ ImplInvalidateSize();
+}
+inline void SwFrm::InvalidatePrt()
+{
+ if ( bValidPrtArea )
+ ImplInvalidatePrt();
+}
+inline void SwFrm::InvalidatePos()
+{
+ if ( bValidPos )
+ ImplInvalidatePos();
+}
+inline void SwFrm::InvalidateLineNum()
+{
+ if ( bValidLineNum )
+ ImplInvalidateLineNum();
+}
+
+inline void SwFrm::InvalidateAll()
+{
+ if ( bValidPrtArea && bValidSize && bValidPos )
+ ImplInvalidatePos();
+ bValidPrtArea = bValidSize = bValidPos = FALSE;
+}
+
+inline void SwFrm::InvalidateNextPos( BOOL bNoFtn )
+{
+ if ( pNext && !pNext->IsSctFrm() )
+ pNext->InvalidatePos();
+#ifndef C30 // vielleicht geht es ja bei C40 ?
+ else
+ ImplInvalidateNextPos( bNoFtn );
+#else
+ if ( !pNext )
+ ImplInvalidateNextPos( bNoFtn );
+#endif
+}
+
+inline void SwFrm::Calc() const
+{
+ if ( !bValidPos || !bValidPrtArea || !bValidSize )
+ ((SwFrm*)this)->PrepareMake();
+}
+inline void SwFrm::OptCalc() const
+{
+ if ( !bValidPos || !bValidPrtArea || !bValidSize )
+ ((SwFrm*)this)->OptPrepareMake();
+}
+
+inline Point SwFrm::GetRelPos() const
+{
+ Point aRet( aFrm.Pos() );
+ //hier wird gecasted, weil die Klasse SwLayoutFrm nur vorward-
+ //declariert ist.
+ aRet -= ((SwFrm*)GetUpper())->Prt().Pos();
+ aRet -= ((SwFrm*)GetUpper())->Frm().Pos();
+ return aRet;
+}
+
+inline const SwPageFrm *SwFrm::FindPageFrm() const
+{
+ return ((SwFrm*)this)->FindPageFrm();
+}
+inline const SwRootFrm *SwFrm::FindRootFrm() const
+{
+ return ((SwFrm*)this)->FindRootFrm();
+}
+inline const SwFrm *SwFrm::FindColFrm() const
+{
+ return ((SwFrm*)this)->FindColFrm();
+}
+inline const SwFrm *SwFrm::FindFooterOrHeader() const
+{
+ return ((SwFrm*)this)->FindFooterOrHeader();
+}
+inline SwTabFrm *SwFrm::FindTabFrm()
+{
+ return IsInTab() ? ImplFindTabFrm() : 0;
+}
+inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( BOOL bFtn ) const
+{
+ return ((SwFrm*)this)->FindFtnBossFrm( bFtn );
+}
+inline SwFtnFrm *SwFrm::FindFtnFrm()
+{
+ return IsInFtn() ? ImplFindFtnFrm() : 0;
+}
+inline SwFlyFrm *SwFrm::FindFlyFrm()
+{
+ return IsInFly() ? ImplFindFlyFrm() : 0;
+}
+inline SwSectionFrm *SwFrm::FindSctFrm()
+{
+ return IsInSct() ? ImplFindSctFrm() : 0;
+}
+
+
+inline const SwTabFrm *SwFrm::FindTabFrm() const
+{
+ return IsInTab() ? ((SwFrm*)this)->ImplFindTabFrm() : 0;
+}
+inline const SwFtnFrm *SwFrm::FindFtnFrm() const
+{
+ return IsInFtn() ? ((SwFrm*)this)->ImplFindFtnFrm() : 0;
+}
+inline const SwFlyFrm *SwFrm::FindFlyFrm() const
+{
+ return IsInFly() ? ((SwFrm*)this)->ImplFindFlyFrm() : 0;
+}
+inline const SwSectionFrm *SwFrm::FindSctFrm() const
+{
+ return IsInSct() ? ((SwFrm*)this)->ImplFindSctFrm() : 0;
+}
+inline SwFrm *SwFrm::FindNext()
+{
+ if ( pNext )
+ return pNext;
+ else
+ return _FindNext();
+}
+inline const SwFrm *SwFrm::FindNext() const
+{
+ if ( pNext )
+ return pNext;
+ else
+ return ((SwFrm*)this)->_FindNext();
+}
+inline SwCntntFrm *SwFrm::FindNextCnt()
+{
+ if ( pNext && pNext->IsCntntFrm() )
+ return (SwCntntFrm*)pNext;
+ else
+ return _FindNextCnt();
+}
+inline const SwCntntFrm *SwFrm::FindNextCnt() const
+{
+ if ( pNext && pNext->IsCntntFrm() )
+ return (SwCntntFrm*)pNext;
+ else
+ return ((SwFrm*)this)->_FindNextCnt();
+}
+inline SwFrm *SwFrm::FindPrev()
+{
+ if ( pPrev && !pPrev->IsSctFrm() )
+ return pPrev;
+ else
+ return _FindPrev();
+}
+inline const SwFrm *SwFrm::FindPrev() const
+{
+ if ( pPrev && !pPrev->IsSctFrm() )
+ return pPrev;
+ else
+ return ((SwFrm*)this)->_FindPrev();
+}
+
+
+inline SwCntntFrm *SwFrm::GetNextCntntFrm() const
+{
+ if ( GetNext() && GetNext()->IsCntntFrm() )
+ return (SwCntntFrm*)GetNext();
+ else
+ return ImplGetNextCntntFrm();
+}
+inline SwCntntFrm *SwFrm::GetPrevCntntFrm() const
+{
+ if ( GetPrev() && GetPrev()->IsCntntFrm() )
+ return (SwCntntFrm*)GetPrev();
+ else
+ return ImplGetPrevCntntFrm();
+}
+
+
+inline BOOL SwFrm::IsLayoutFrm() const
+{
+ return GetType() & FRM_LAYOUT ? TRUE : FALSE;
+}
+inline BOOL SwFrm::IsRootFrm() const
+{
+ return nType == FRMC_ROOT;
+}
+inline BOOL SwFrm::IsPageFrm() const
+{
+ return nType == FRMC_PAGE;
+}
+inline BOOL SwFrm::IsColumnFrm() const
+{
+ return nType == FRMC_COLUMN;
+}
+inline BOOL SwFrm::IsFtnBossFrm() const
+{
+ return GetType() & FRM_FTNBOSS ? TRUE : FALSE;
+}
+inline BOOL SwFrm::IsHeaderFrm() const
+{
+ return nType == FRMC_HEADER;
+}
+inline BOOL SwFrm::IsFooterFrm() const
+{
+ return nType == FRMC_FOOTER;
+}
+inline BOOL SwFrm::IsFtnContFrm() const
+{
+ return nType == FRMC_FTNCONT;
+}
+inline BOOL SwFrm::IsFtnFrm() const
+{
+ return nType == FRMC_FTN;
+}
+inline BOOL SwFrm::IsBodyFrm() const
+{
+ return nType == FRMC_BODY;
+}
+inline BOOL SwFrm::IsFlyFrm() const
+{
+ return nType == FRMC_FLY;
+}
+inline BOOL SwFrm::IsSctFrm() const
+{
+ return nType == FRMC_SECTION;
+}
+inline BOOL SwFrm::IsTabFrm() const
+{
+ return nType == FRMC_TAB;
+}
+inline BOOL SwFrm::IsRowFrm() const
+{
+ return nType == FRMC_ROW;
+}
+inline BOOL SwFrm::IsCellFrm() const
+{
+ return nType == FRMC_CELL;
+}
+inline BOOL SwFrm::IsCntntFrm() const
+{
+ return GetType() & FRM_CNTNT ? TRUE : FALSE;
+}
+inline BOOL SwFrm::IsTxtFrm() const
+{
+ return nType == FRMC_TXT;
+}
+inline BOOL SwFrm::IsNoTxtFrm() const
+{
+ return nType == FRMC_NOTXT;
+}
+inline BOOL SwFrm::IsFlowFrm() const
+{
+ return GetType() & 0xCA00 ? TRUE : FALSE; //TabFrm, CntntFrm, SectionFrm
+}
+inline BOOL SwFrm::IsRetoucheFrm() const
+{
+ return GetType() & 0xCA40 ? TRUE : FALSE; //TabFrm, CntntFrm, SectionFrm, Ftnfrm
+}
+#ifdef ACCESSIBLE_LAYOUT
+inline BOOL SwFrm::IsAccessibleFrm() const
+{
+ return GetType() & FRM_ACCESSIBLE ? TRUE : FALSE;
+}
+#endif
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/frmsh.hxx b/binfilter/bf_sw/source/core/inc/frmsh.hxx
new file mode 100644
index 000000000000..b19099dc0a82
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/frmsh.hxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FRMSH_HXX
+#define _FRMSH_HXX
+
+#include "rootfrm.hxx"
+namespace binfilter {
+
+/*************************************************************************
+|*
+|* SwFrm::GetShell()
+|*
+|* Beschreibung Liefert die aktuelle Shell, ggf. auch NULL.
+|* Ersterstellung MA 14. Aug. 92
+|* Letzte Aenderung MA 18. Feb. 99
+|*
+|*************************************************************************/
+
+inline ViewShell * SwFrm::GetShell() const
+{
+ const SwRootFrm *pRoot;
+ if ( 0 != (pRoot = FindRootFrm()) )
+ return pRoot->GetCurrShell();
+ return 0;
+}
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/frmtool.hxx b/binfilter/bf_sw/source/core/inc/frmtool.hxx
new file mode 100644
index 000000000000..fe106393caad
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/frmtool.hxx
@@ -0,0 +1,460 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FRMTOOL_HXX
+#define _FRMTOOL_HXX
+
+#include "swtypes.hxx"
+#include "layfrm.hxx"
+#include "frmatr.hxx"
+#include "swcache.hxx"
+class BigInt;
+class OutputDevice;
+namespace binfilter {
+
+class SwPageFrm;
+class SwFlyFrm;
+class SwCntntFrm;
+class SwFtnContFrm;
+class SwDoc;
+class SwAttrSet;
+class SdrObject;
+
+class SvxBrushItem;
+class SdrMarkList;
+class SwNodeIndex;
+
+class SwPageDesc;
+class SwCrsrShell;
+// OD 21.05.2003 #108789#
+class SwTxtFrm;
+
+#if defined(MSC)
+#define MA_FASTCALL __fastcall
+#else
+#define MA_FASTCALL
+#endif
+
+#define WEIT_WECH LONG_MAX - 20000 //Initale Position der Flys.
+#define BROWSE_HEIGHT 56700L * 10L //10 Meter
+
+#define GRFNUM_NO 0
+#define GRFNUM_YES 1
+#define GRFNUM_REPLACE 2
+
+//Painten des Hintergrunds. Mit Brush oder Graphic.
+// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
+// consider background transparency, saved in the color of the brush item
+void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *,
+ const SwRect &rOrg, const SwRect &rOut, const BYTE nGrfNum = GRFNUM_NO,
+ const sal_Bool bConsiderBackgroundTransparency = sal_False );
+
+// OD 24.01.2003 #106593# - method to align graphic rectangle
+// Created declaration here to avoid <extern> declarations
+void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
+
+//Fly besorgen, wenn keine List hineingereicht wird, wir die der aktuellen
+//Shell benutzt.
+//Implementierung in feshview.cxx
+SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
+
+SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart );
+void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling );
+
+//Nicht gleich die math.lib anziehen.
+ULONG MA_FASTCALL SqRt( BigInt nX );
+
+//CntntNodes besorgen, CntntFrms erzeugen und in den LayFrm haengen.
+void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, ULONG nIndex,
+ BOOL bPages = FALSE, ULONG nEndIndex = 0,
+ SwFrm *pPrv = 0 );
+
+//Erzeugen der Frames fuer einen bestimmten Bereich, verwendet _InsertCnt
+void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
+ const SwNodeIndex &rEndIdx );
+
+//Um z.B. fuer Tabelleheadlines das Erzeugen der Flys in _InsertCnt zu unterbinden.
+extern FASTBOOL bDontCreateObjects;
+
+//Fuer FlyCnts, siehe SwFlyAtCntFrm::MakeAll()
+extern FASTBOOL bSetCompletePaintOnInvalidate;
+
+//Fuer Tabelleneinstellung per Tastatur.
+long MA_FASTCALL CalcRowRstHeight( SwLayoutFrm *pRow );
+long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm ); //MA_FLY_HEIGHT
+
+//Neue Seite einsetzen
+SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
+ BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn,
+ SwFrm *pSibling );
+
+//Flys bei der Seite anmelden.
+void RegistFlys( SwPageFrm*, const SwLayoutFrm* );
+
+//Benachrichtung des Fly Hintergrundes wenn Notwendig.
+void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld );
+
+void Notify_Background( SdrObject *pObj, SwPageFrm *pPage, const SwRect& rRect,
+ const PrepareHint eHint, const BOOL bInva );
+
+const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos );
+
+BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj );
+
+const SwFrm *FindKontext( const SwFrm *pFrm, USHORT nAdditionalKontextTyp );
+
+BOOL IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm );
+
+void MA_ParkCrsr( SwPageDesc *pDesc, SwCrsrShell &rSh );
+
+const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage );
+
+// JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
+// gerufen
+SwFrm* GetFrmOfModify( SwModify&, USHORT nFrmType, const Point* = 0,
+ const SwPosition *pPos = 0,
+ const BOOL bCalcFrm = FALSE );
+
+//Sollen ExtraDaten (Reline-Strich, Zeilennummern) gepaintet werden?
+FASTBOOL IsExtraData( const SwDoc *pDoc );
+
+// OD 14.03.2003 #i11760# - method declaration <CalcCntnt(..)>
+void CalcCntnt( SwLayoutFrm *pLay,
+ bool bNoColl = false,
+ bool bNoCalcFollow = false );
+
+
+//Die Notify-Klassen merken sich im CTor die aktuellen Groessen und fuehren
+//im DTor ggf. die notwendigen Benachrichtigungen durch.
+
+class SwFrmNotify
+{
+protected:
+ SwFrm *pFrm;
+ const SwRect aFrm;
+ const SwRect aPrt;
+ SwTwips mnFlyAnchorOfst;
+ SwTwips mnFlyAnchorOfstNoWrap;
+ FASTBOOL bHadFollow;
+ FASTBOOL bInvaKeep;
+#ifdef ACCESSIBLE_LAYOUT
+ FASTBOOL bValidSize;
+#endif
+
+public:
+ SwFrmNotify( SwFrm *pFrm );
+ ~SwFrmNotify();
+
+ const SwRect &Frm() const { return aFrm; }
+ const SwRect &Prt() const { return aPrt; }
+ void SetInvaKeep() { bInvaKeep = TRUE; }
+};
+
+class SwLayNotify : public SwFrmNotify
+{
+ SwTwips nHeightOfst;
+ SwTwips nWidthOfst;
+ FASTBOOL bLowersComplete;
+
+ SwLayoutFrm *GetLay() { return (SwLayoutFrm*)pFrm; }
+public:
+ SwLayNotify( SwLayoutFrm *pLayFrm );
+ ~SwLayNotify();
+
+ void AddHeightOfst ( SwTwips nAdd ) { nHeightOfst += nAdd; }
+ void AddWidthOfst ( SwTwips nAdd ) { nHeightOfst += nAdd; }
+ void SubtractHeightOfst( SwTwips nSub ) { nWidthOfst -= nSub; }
+ void SubtractWidthOfst ( SwTwips nSub ) { nWidthOfst -= nSub; }
+ SwTwips GetHeightOfst() const { return nHeightOfst; }
+ SwTwips GetWidthOfst() const { return nWidthOfst; }
+ void ResetHeightOfst() { nHeightOfst = 0; }
+ void ResetWidthOfst() { nWidthOfst = 0; }
+
+ void SetLowersComplete( FASTBOOL b ) { bLowersComplete = b; }
+ FASTBOOL IsLowersComplete() { return bLowersComplete; }
+};
+
+class SwFlyNotify : public SwLayNotify
+{
+ SwPageFrm *pOldPage;
+ const SwRect aFrmAndSpace;
+ SwFlyFrm *GetFly() { return (SwFlyFrm*)pFrm; }
+public:
+ SwFlyNotify( SwFlyFrm *pFlyFrm );
+ ~SwFlyNotify();
+
+ SwPageFrm *GetOldPage() const { return pOldPage; }
+};
+
+class SwCntntNotify : public SwFrmNotify
+{
+ SwCntntFrm *GetCnt() { return (SwCntntFrm*)pFrm; }
+public:
+ SwCntntNotify( SwCntntFrm *pCntFrm );
+ ~SwCntntNotify();
+};
+
+//SwBorderAttrs kapselt die Berechnung fuer die Randattribute inclusive
+//Umrandung. Die Attribute und die errechneten Werte werden gecached.
+//Neu: Die gesammte Klasse wird gecached.
+
+//!!!Achtung: Wenn weitere Attribute gecached werden muss unbedingt die
+//Methode Modify::Modify mitgepflegt werden!!!
+
+// OD 23.01.2003 #106895# - delete old method <SwBorderAttrs::CalcRight()> and
+// the stuff that belongs to it.
+class SwBorderAttrs : public SwCacheObj
+{
+ const SwAttrSet &rAttrSet;
+ const SvxULSpaceItem &rUL;
+ const SvxLRSpaceItem &rLR;
+ const SvxBoxItem &rBox;
+ const SvxShadowItem &rShadow;
+ const Size aFrmSize; //Die FrmSize
+
+ BOOL bBorderDist :1; //Ist's ein Frm der auch ohne Linie
+ //einen Abstand haben kann?
+
+ //Mit den Folgenden Bools werden die gecache'ten Werte fuer UNgueltig
+ //erklaert - bis sie einmal berechnet wurden.
+ BOOL bTopLine :1;
+ BOOL bBottomLine :1;
+ BOOL bLeftLine :1;
+ BOOL bRightLine :1;
+ BOOL bTop :1;
+ BOOL bBottom :1;
+ BOOL bLine :1;
+
+ BOOL bIsLine :1; //Umrandung an mind. einer Kante?
+
+ BOOL bCacheGetLine :1; //GetTopLine(), GetBottomLine() cachen?
+ BOOL bCachedGetTopLine :1; //GetTopLine() gecached?
+ BOOL bCachedGetBottomLine :1; //GetBottomLine() gecached?
+ // OD 21.05.2003 #108789# - booleans indicating, if values <bJoinedWithPrev>
+ // and <bJoinedWithNext> are cached and valid.
+ // Caching depends on value of <bCacheGetLine>.
+ mutable BOOL bCachedJoinedWithPrev :1;
+ mutable BOOL bCachedJoinedWithNext :1;
+ // OD 21.05.2003 #108789# - booleans indicating, if borders are joined
+ // with previous/next frame.
+ BOOL bJoinedWithPrev :1;
+ BOOL bJoinedWithNext :1;
+
+ //Die gecache'ten Werte, undefiniert bis sie einmal berechnet wurden.
+ USHORT nTopLine,
+ nBottomLine,
+ nLeftLine,
+ nRightLine,
+ nTop,
+ nBottom,
+ nGetTopLine,
+ nGetBottomLine;
+
+ //Nur die Lines + Shadow errechnen.
+ void _CalcTopLine();
+ void _CalcBottomLine();
+ void _CalcLeftLine();
+ void _CalcRightLine();
+
+ //Lines + Shadow + Abstaende
+ void _CalcTop();
+ void _CalcBottom();
+
+
+ void _GetTopLine ( const SwFrm *pFrm );
+ void _GetBottomLine( const SwFrm *pFrm );
+
+ // OD 21.05.2003 #108789# - private methods to calculate cached values
+ // <bJoinedWithPrev> and <bJoinedWithNext>.
+ void _CalcJoinedWithPrev( const SwFrm& _rFrm );
+ void _CalcJoinedWithNext( const SwFrm& _rFrm );
+
+ // OD 21.05.2003 #108789# - internal helper method for methods
+ // <_CalcJoinedWithPrev> and <_CalcJoinedWithNext>.
+ BOOL _JoinWithCmp( const SwFrm& _rCallerFrm,
+ const SwFrm& _rCmpFrm ) const;
+
+ //Rechte und linke Linie sowie LRSpace gleich?
+ // OD 21.05.2003 #108789# - change name of 1st parameter - "rAttrs" -> "rCmpAttrs".
+ BOOL CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
+ const SwFrm *pCaller,
+ const SwFrm *pCmp ) const;
+
+public:
+ DECL_FIXEDMEMPOOL_NEWDEL(SwBorderAttrs)
+
+ SwBorderAttrs( const SwModify *pOwner, const SwFrm *pConstructor );
+ ~SwBorderAttrs();
+
+ inline const SwAttrSet &GetAttrSet() const { return rAttrSet; }
+ inline const SvxULSpaceItem &GetULSpace() const { return rUL; }
+ inline const SvxLRSpaceItem &GetLRSpace() const { return rLR; }
+ inline const SvxBoxItem &GetBox() const { return rBox; }
+ inline const SvxShadowItem &GetShadow() const { return rShadow; }
+
+ inline USHORT CalcTopLine() const;
+ inline USHORT CalcBottomLine() const;
+ inline USHORT CalcLeftLine() const;
+ inline USHORT CalcRightLine() const;
+ inline USHORT CalcTop() const;
+ inline USHORT CalcBottom() const;
+ long CalcLeft( const SwFrm *pCaller ) const;
+ long CalcRight( const SwFrm *pCaller ) const;
+
+
+ inline const Size &GetSize() const { return aFrmSize; }
+
+ inline BOOL IsBorderDist() const { return bBorderDist; }
+
+ //Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
+ inline USHORT GetTopLine ( const SwFrm *pFrm ) const;
+ inline USHORT GetBottomLine( const SwFrm *pFrm ) const;
+ inline void SetGetCacheLine( BOOL bNew ) const;
+ // OD 21.05.2003 #108789# - accessors for cached values <bJoinedWithPrev>
+ // and <bJoinedWithPrev>
+ BOOL JoinedWithPrev( const SwFrm& _rFrm ) const;
+ BOOL JoinedWithNext( const SwFrm& _rFrm ) const;
+};
+
+class SwBorderAttrAccess : public SwCacheAccess
+{
+ const SwFrm *pConstructor; //opt: Zur weitergabe an SwBorderAttrs
+protected:
+ virtual SwCacheObj *NewObj();
+
+public:
+ SwBorderAttrAccess( SwCache &rCache, const SwFrm *pOwner );
+
+ SwBorderAttrs *Get();
+};
+
+//---------------------------------------------------------------------
+//Iterator fuer die DrawObjecte einer Seite. Die Objecte werden Nach ihrer
+//Z-Order iteriert.
+//Das iterieren ist nicht eben billig, denn fuer alle Operationen muss jeweils
+//ueber das gesamte SortArray iteriert werden.
+class SwOrderIter
+{
+ const SwPageFrm *pPage;
+ const SdrObject *pCurrent;
+ const FASTBOOL bFlysOnly;
+public:
+ SwOrderIter( const SwPageFrm *pPage, FASTBOOL bFlysOnly = TRUE );
+
+ void Current( const SdrObject *pNew ) { pCurrent = pNew; }
+ const SdrObject *Current() const { return pCurrent; }
+ const SdrObject *operator()() const { return pCurrent; }
+ const SdrObject *Bottom();
+ const SdrObject *Next();
+};
+
+
+class StackHack
+{
+ static BYTE nCnt;
+ static BOOL bLocked;
+public:
+ StackHack()
+ {
+ if ( ++StackHack::nCnt > 50 )
+ StackHack::bLocked = TRUE;
+ }
+ ~StackHack()
+ {
+ if ( --StackHack::nCnt == 0 )
+ StackHack::bLocked = FALSE;
+ }
+
+ static BOOL IsLocked() { return StackHack::bLocked; }
+ static BYTE Count() { return StackHack::nCnt; }
+};
+
+
+//Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
+inline USHORT SwBorderAttrs::GetTopLine ( const SwFrm *pFrm ) const
+{
+ if ( !bCachedGetTopLine )
+ ((SwBorderAttrs*)this)->_GetTopLine( pFrm );
+ return nGetTopLine;
+}
+inline USHORT SwBorderAttrs::GetBottomLine( const SwFrm *pFrm ) const
+{
+ if ( !bCachedGetBottomLine )
+ ((SwBorderAttrs*)this)->_GetBottomLine( pFrm );
+ return nGetBottomLine;
+}
+inline void SwBorderAttrs::SetGetCacheLine( BOOL bNew ) const
+{
+ ((SwBorderAttrs*)this)->bCacheGetLine = bNew;
+ ((SwBorderAttrs*)this)->bCachedGetBottomLine =
+ ((SwBorderAttrs*)this)->bCachedGetTopLine = FALSE;
+ // OD 21.05.2003 #108789# - invalidate cache for values <bJoinedWithPrev>
+ // and <bJoinedWithNext>.
+ bCachedJoinedWithPrev = FALSE;
+ bCachedJoinedWithNext = FALSE;
+}
+
+inline USHORT SwBorderAttrs::CalcTopLine() const
+{
+ if ( bTopLine )
+ ((SwBorderAttrs*)this)->_CalcTopLine();
+ return nTopLine;
+}
+inline USHORT SwBorderAttrs::CalcBottomLine() const
+{
+ if ( bBottomLine )
+ ((SwBorderAttrs*)this)->_CalcBottomLine();
+ return nBottomLine;
+}
+inline USHORT SwBorderAttrs::CalcLeftLine() const
+{
+ if ( bLeftLine )
+ ((SwBorderAttrs*)this)->_CalcLeftLine();
+ return nLeftLine;
+}
+inline USHORT SwBorderAttrs::CalcRightLine() const
+{
+ if ( bRightLine )
+ ((SwBorderAttrs*)this)->_CalcRightLine();
+ return nRightLine;
+}
+inline USHORT SwBorderAttrs::CalcTop() const
+{
+ if ( bTop )
+ ((SwBorderAttrs*)this)->_CalcTop();
+ return nTop;
+}
+inline USHORT SwBorderAttrs::CalcBottom() const
+{
+ if ( bBottom )
+ ((SwBorderAttrs*)this)->_CalcBottom();
+ return nBottom;
+}
+} //namespace binfilter
+#endif //_FRMTOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/ftnboss.hxx b/binfilter/bf_sw/source/core/inc/ftnboss.hxx
new file mode 100644
index 000000000000..9eb0ad7167c9
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/ftnboss.hxx
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FTNBOSS_HXX
+#define _FTNBOSS_HXX
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+class SwFtnBossFrm;
+class SwFtnContFrm;
+class SwFtnFrm;
+class SwTxtFtn;
+
+
+//Setzen des maximalen Fussnotenbereiches. Restaurieren des alten Wertes im DTor.
+//Implementierung im ftnfrm.cxx
+class SwSaveFtnHeight
+{
+ SwFtnBossFrm *pBoss;
+ const SwTwips nOldHeight;
+ SwTwips nNewHeight;
+public:
+ SwSaveFtnHeight( SwFtnBossFrm *pBs, const SwTwips nDeadLine );
+ ~SwSaveFtnHeight();
+};
+
+#define NA_ONLY_ADJUST 0
+#define NA_GROW_SHRINK 1
+#define NA_GROW_ADJUST 2
+#define NA_ADJUST_GROW 3
+
+class SwFtnBossFrm: public SwLayoutFrm
+{
+ //Fuer die privaten Fussnotenoperationen
+ friend class SwFrm;
+ friend class SwSaveFtnHeight;
+ friend class SwPageFrm; // fuer das Setzen der MaxFtnHeight
+
+ //Maximale Hoehe des Fussnotencontainers fuer diese Seite.
+ SwTwips nMaxFtnHeight;
+
+ SwFtnContFrm *MakeFtnCont();
+ SwFtnFrm *FindFirstFtn();
+ BYTE _NeighbourhoodAdjustment( const SwFrm* pFrm ) const;
+protected:
+
+ void InsertFtn( SwFtnFrm * );
+ static void ResetFtn( const SwFtnFrm *pAssumed );
+public:
+ inline SwFtnBossFrm( SwFrmFmt* pFmt) : SwLayoutFrm( pFmt ) {}
+
+ SwLayoutFrm *FindBodyCont();
+ inline const SwLayoutFrm *FindBodyCont() const;
+ inline void SetMaxFtnHeight( const SwTwips nNewMax ) { nMaxFtnHeight = nNewMax; }
+
+ //Fussnotenschnittstelle
+ void AppendFtn( SwCntntFrm *, SwTxtFtn * );
+ void RemoveFtn( const SwCntntFrm *, const SwTxtFtn *, BOOL bPrep = TRUE );
+ static SwFtnFrm *FindFtn( const SwCntntFrm *, const SwTxtFtn * );
+ SwFtnContFrm *FindFtnCont();
+ inline const SwFtnContFrm *FindFtnCont() const;
+ const SwFtnFrm *FindFirstFtn( SwCntntFrm* ) const;
+ SwFtnContFrm *FindNearestFtnCont( BOOL bDontLeave = FALSE );
+
+ void RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock = FALSE,
+ const SwTxtFtn *pAttr = 0 );
+
+ //SS damit der Textformatierer Temporaer die Fussnotenhoehe begrenzen
+ //kann. DeadLine in Dokumentkoordinaten.
+ void SetFtnDeadLine( const SwTwips nDeadLine );
+ SwTwips GetMaxFtnHeight() const { return nMaxFtnHeight; }
+
+ //Liefert den Wert, der noch uebrig ist, bis der Body seine minimale
+ //Hoehe erreicht hat.
+ SwTwips GetVarSpace() const;
+
+ //Layoutseitig benoetigte Methoden
+ /// OD 03.04.2003 #108446# - add parameters <_bCollectOnlyPreviousFtns> and
+ /// <_pRefFtnBossFrm> in order to control, if only footnotes, which are positioned
+ /// before the given reference footnote boss frame have to be collected.
+ /// Note: if parameter <_bCollectOnlyPreviousFtns> is true, then parameter
+ /// <_pRefFtnBossFrm> have to be referenced to an object.
+ /// OD 03.04.2003 #108446# - add parameter <_bCollectOnlyPreviousFtns> in
+ /// order to control, if only footnotes, which are positioned before the
+ /// footnote boss frame <this> have to be collected.
+ // Sollte AdjustNeighbourhood gerufen werden (oder Grow/Shrink)?
+ BYTE NeighbourhoodAdjustment( const SwFrm* pFrm ) const
+ { return IsPageFrm() ? NA_ONLY_ADJUST : _NeighbourhoodAdjustment( pFrm ); }
+};
+
+inline const SwLayoutFrm *SwFtnBossFrm::FindBodyCont() const
+{
+ return ((SwFtnBossFrm*)this)->FindBodyCont();
+}
+inline const SwFtnContFrm *SwFtnBossFrm::FindFtnCont() const
+{
+ return ((SwFtnBossFrm*)this)->FindFtnCont();
+}
+
+} //namespace binfilter
+#endif //_FTNBOSS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/ftnfrm.hxx b/binfilter/bf_sw/source/core/inc/ftnfrm.hxx
new file mode 100644
index 000000000000..15d3566664a8
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/ftnfrm.hxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _FTNFRM_HXX
+#define _FTNFRM_HXX
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+class SwCntntFrm;
+class SwTxtFtn;
+class SwBorderAttrs;
+class SwFtnFrm;
+
+//Fuer Fussnoten gibt es einen Speziellen Bereich auf der Seite. Dieser
+//Bereich ist ein SwFtnContFrm.
+//Jede Fussnote ist durch einen SwFtnFrm abgegrenzt, dieser nimmt die
+//Fussnotenabsaetze auf. SwFtnFrm koennen aufgespalten werden, sie gehen
+//dann auf einer anderen Seite weiter.
+
+class SwFtnContFrm: public SwLayoutFrm
+{
+public:
+ SwFtnContFrm( SwFrmFmt* );
+
+
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+};
+
+class SwFtnFrm: public SwLayoutFrm
+{
+ //Zeiger auf den FtnFrm in dem die Fussnote weitergefuehrt wird:
+ // 0 wenn kein Follow vorhanden,
+ // this beim letzten
+ // der Follow sonst.
+ SwFtnFrm *pFollow;
+ SwFtnFrm *pMaster; //Der FtnFrm dessen Follow ich bin.
+ SwCntntFrm *pRef; //In diesem CntntFrm steht die Fussnotenref.
+ SwTxtFtn *pAttr; //Fussnotenattribut (zum wiedererkennen)
+
+ BOOL bBackMoveLocked; //Absaetze in dieser Fussnote duerfen derzeit
+ //nicht rueckwaerts fliessen.
+#ifdef DBG_UTIL
+protected:
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+#endif
+
+
+public:
+ SwFtnFrm( SwFrmFmt*, SwCntntFrm*, SwTxtFtn* );
+
+ virtual void Cut();
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+
+
+#ifndef DBG_UTIL
+ const SwCntntFrm *GetRef() const { return pRef; }
+ SwCntntFrm *GetRef() { return pRef; }
+#else
+ //JP 15.10.2001: in a non pro version test if the attribute has the same
+ // meaning which his reference is
+ const SwCntntFrm *GetRef() const;
+ SwCntntFrm *GetRef();
+#endif
+ const SwCntntFrm *GetRefFromAttr() const;
+ SwCntntFrm *GetRefFromAttr();
+
+ const SwFtnFrm *GetFollow() const { return pFollow; }
+ SwFtnFrm *GetFollow() { return pFollow; }
+
+ const SwFtnFrm *GetMaster() const { return pMaster; }
+ SwFtnFrm *GetMaster() { return pMaster; }
+
+ const SwTxtFtn *GetAttr() const { return pAttr; }
+ SwTxtFtn *GetAttr() { return pAttr; }
+
+ void SetFollow( SwFtnFrm *pNew ) { pFollow = pNew; }
+ void SetMaster( SwFtnFrm *pNew ) { pMaster = pNew; }
+ void SetRef ( SwCntntFrm *pNew ) { pRef = pNew; }
+
+ void InvalidateNxtFtnCnts( SwPageFrm* pPage );
+
+ void LockBackMove() { bBackMoveLocked = TRUE; }
+ void UnlockBackMove() { bBackMoveLocked = FALSE;}
+ BOOL IsBackMoveLocked() { return bBackMoveLocked; }
+
+ // Verhindert, dass der letzte Inhalt den SwFtnFrm mitloescht (Cut())
+ inline void ColLock() { bColLocked = TRUE; }
+ inline void ColUnlock() { bColLocked = FALSE; }
+};
+
+} //namespace binfilter
+#endif //_FTNFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/hffrm.hxx b/binfilter/bf_sw/source/core/inc/hffrm.hxx
new file mode 100644
index 000000000000..bb467a1014d7
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/hffrm.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _HFFRM_HXX
+#define _HFFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+
+class SwHeadFootFrm : public SwLayoutFrm
+{
+protected:
+ void FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs);
+ void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs);
+ inline BOOL GetEatSpacing() const; // in hffrm.cxx
+public:
+ SwHeadFootFrm(SwFrmFmt * pFrm, USHORT aType);
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual SwTwips GrowFrm( SwTwips,
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips ShrinkFrm( SwTwips,
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+};
+
+class SwHeaderFrm: public SwHeadFootFrm
+{
+public:
+ SwHeaderFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_HEADER) {};
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm)
+};
+
+class SwFooterFrm: public SwHeadFootFrm
+{
+public:
+ SwFooterFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_FOOTER) {};
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwFooterFrm)
+};
+
+} //namespace binfilter
+#endif //_HFFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/layact.hxx b/binfilter/bf_sw/source/core/inc/layact.hxx
new file mode 100644
index 000000000000..c96364cef1c1
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/layact.hxx
@@ -0,0 +1,245 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _LAYACT_HXX
+#define _LAYACT_HXX
+
+#include "swtypes.hxx"
+#include "swrect.hxx"
+namespace binfilter {
+
+class SwRootFrm;
+class SwLayoutFrm;
+class SwPageFrm;
+class SwFlyFrm;
+class SwFlyInCntFrm;
+class SwCntntFrm;
+class SwTabFrm;
+class SwViewImp;
+class SwCntntNode;
+class SwWait;
+
+//Die Verwendung der LayAction laeuft immer gleich ab:
+//
+// 1. Erzeugen des LayAction-Objektes.
+// 2. Einstellen des gewuenschten Verhaltens mittels der Set-Methoden
+// 3. Aufruf von Action()
+// 4. Baldiges Zerstoeren des Objektes.
+//
+// Das Objekt meldet sich im CTor beim SwViewImp an und erst im DTor
+// wieder ab! Es handelt sich mithin um ein typisches Stackobjekt.
+
+
+class SwLayAction
+{
+ SwRootFrm *pRoot;
+ SwViewImp *pImp; //Hier Meldet sich die Action an und ab.
+
+ //Zur Optimierung, damit die Tabellen etwas besser am Crsr kleben beim
+ //Return/Backspace davor.
+ //Wenn der erste TabFrm, der sich Paintet (pro Seite) traegt sich im
+ //Pointer ein. Die CntntFrms unterhalb der Seite brauchen sich
+ //dann nicht mehr bei der Shell zum Painten anmelden.
+ const SwTabFrm *pOptTab;
+
+ SwWait *pWait;
+
+ SfxProgress * pProgress;
+
+ //Wenn ein Absatz - oder was auch immer - bei der Formatierung mehr
+ //als eine Seite rueckwaerts floss traegt er seine neue Seitennummer
+ //hier ein. Die Steuerung der InternalAction kann dann geeignet reagieren.
+ USHORT nPreInvaPage;
+
+ ULONG nStartTicks; //Startzeitpunkt der Aktion, vergeht zu viel Zeit kann
+ //der WaitCrsr per CheckWaitCrsr() eingeschaltet werden.
+
+ USHORT nInputType; //Bei welchem Input soll die Verarbeitung abgebrochen
+ //werden?
+ USHORT nEndPage; //StatBar Steuerung.
+ USHORT nCheckPageNum; //CheckPageDesc() wurde verzoegert wenn != USHRT_MAX
+ //ab dieser Seite Checken.
+
+ BOOL bPaint; //Painten oder nur Formatieren?
+ BOOL bComplete; //Alles bis zum sichtbaren Bereich Formatieren oder
+ //oder nur den sichtbaren Bereich?
+ BOOL bCalcLayout; //Vollstaendige Reformatierung?
+ BOOL bAgain; //Zur automatisch wiederholten Action wenn Seiten
+ //geloscht werden.
+ BOOL bNextCycle; //Wiederaufsetzen bei der ersten Ungueltigen Seite.
+ BOOL bInput; //Zum Abbrechen der Verarbeitung wenn ein Input anliegt.
+ BOOL bIdle; //True wenn die Layaction vom Idler ausgeloest wurde.
+ BOOL bReschedule; //Soll das Reschedule - abhaengig vom Progress -
+ //gerufen werden?
+ BOOL bCheckPages; //CheckPageDescs() ausfuehren oder verzoegern.
+ BOOL bUpdateExpFlds;//Wird gesetzt wenn nach dem Formatierien noch eine
+ //Runde fuer den ExpFld laufen muss.
+ BOOL bBrowseActionStop; //Action fruehzeitig beenden (per bInput) und den
+ //Rest dem Idler ueberlassen.
+ BOOL bWaitAllowed; //Wartecursor erlaubt?
+ BOOL bPaintExtraData; //Anzeige von Zeilennumerierung o. ae. eingeschaltet?
+ BOOL bActionInProgress; // wird in Action() anfangs gesetzt und zum Schluss geloescht
+
+ // OD 14.04.2003 #106346# - new flag for content formatting on interrupt.
+ sal_Bool mbFormatCntntOnInterrupt;
+#ifdef _LAYACT_CXX
+
+ void _AddScrollRect( const SwCntntFrm *, const SwPageFrm *,
+ const SwTwips, const SwTwips );
+ void PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
+ const SwRect &rOldRect, long nOldBottom );
+ BOOL PaintWithoutFlys( const SwRect &, const SwCntntFrm *,
+ const SwPageFrm * );
+ inline BOOL _PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
+ const SwRect & );
+
+ void ChkFlyAnchor( SwFlyFrm *, const SwPageFrm * );
+
+ void FormatFlyLayout( const SwPageFrm * );
+ BOOL FormatFlyCntnt( const SwPageFrm *, sal_Bool bDontShrink );
+ BOOL _FormatFlyCntnt( const SwFlyFrm * );
+ BOOL __FormatFlyCntnt( const SwCntntFrm * );
+ void FormatFlyInCnt( SwFlyInCntFrm* );
+ BOOL FormatLayout( SwLayoutFrm *, BOOL bAddRect = TRUE );
+ BOOL FormatLayoutTab( SwTabFrm *, BOOL bAddRect = TRUE );
+ BOOL FormatLayoutFly( SwFlyFrm *, BOOL bAddRect = TRUE );
+ BOOL FormatCntnt( const SwPageFrm* pPage );
+ void _FormatCntnt( const SwCntntFrm* pCntnt,
+ const SwPageFrm* pPage );
+ BOOL IsShortCut( SwPageFrm *& );
+
+ BOOL TurboAction();
+ BOOL _TurboAction( const SwCntntFrm * );
+ void InternalAction();
+
+ SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage );
+
+ BOOL RemoveEmptyBrowserPages();
+
+ inline void CheckIdleEnd();
+ inline ULONG GetStartTicks() { return nStartTicks; }
+
+#endif
+
+public:
+ SwLayAction( SwRootFrm *pRt, SwViewImp *pImp );
+ ~SwLayAction();
+
+#ifdef _LAYACT_CXX
+ void SetIdle ( BOOL bNew ) { bIdle = bNew; }
+ void SetCheckPages ( BOOL bNew ) { bCheckPages = bNew; }
+ void SetBrowseActionStop(BOOL bNew ) { bBrowseActionStop = bNew; }
+ void SetNextCycle ( BOOL bNew ) { bNextCycle = bNew; }
+
+ BOOL IsWaitAllowed() const { return bWaitAllowed; }
+ BOOL IsNextCycle() const { return bNextCycle; }
+ BOOL IsInput() const { return bInput; }
+ BOOL IsWait() const { return 0 != pWait; }
+ BOOL IsPaint() const { return bPaint; }
+ BOOL IsIdle() const { return bIdle; }
+ BOOL IsReschedule() const { return bReschedule; }
+ BOOL IsPaintExtraData() const { return bPaintExtraData;}
+ BOOL IsStopPrt() const;
+ BOOL IsInterrupt() const { return IsInput() || IsStopPrt(); }
+
+ USHORT GetInputType() const { return nInputType; }
+#endif
+
+ //Einstellen der Action auf das gewuenschte Verhalten.
+ void SetPaint ( BOOL bNew ) { bPaint = bNew; }
+ void SetComplete ( BOOL bNew ) { bComplete = bNew; }
+ void SetStatBar ( BOOL bNew );
+ void SetInputType ( USHORT nNew ) { nInputType = nNew; }
+ void SetCalcLayout ( BOOL bNew ) { bCalcLayout = bNew; }
+ void SetReschedule ( BOOL bNew ) { bReschedule = bNew; }
+ void SetWaitAllowed ( BOOL bNew ) { bWaitAllowed = bNew; }
+
+ void SetAgain() { bAgain = TRUE; }
+ void SetUpdateExpFlds() {bUpdateExpFlds = TRUE; }
+ void SetProgress(SfxProgress * _pProgress = NULL)
+ { pProgress = _pProgress; }
+
+ inline void SetCheckPageNum( USHORT nNew );
+ inline void SetCheckPageNumDirect( USHORT nNew ) { nCheckPageNum = nNew; }
+
+ void Action(); //Jetzt gehts loos...
+ void Reset(); //Zurueck auf CTor-Defaults.
+
+ BOOL IsAgain() const { return bAgain; }
+ BOOL IsComplete() const { return bComplete; }
+ BOOL IsExpFlds() const { return bUpdateExpFlds; }
+ BOOL IsCalcLayout() const { return bCalcLayout; }
+ BOOL IsCheckPages() const { return bCheckPages; }
+ BOOL IsBrowseActionStop() const { return bBrowseActionStop; }
+ BOOL IsActionInProgress() const { return bActionInProgress; }
+
+ USHORT GetCheckPageNum() const { return nCheckPageNum; }
+
+ //Auch andere sollen den Wartecrsr einschalten koennen.
+ void CheckWaitCrsr();
+};
+
+class SwLayIdle
+{
+
+ SwRootFrm *pRoot;
+ SwViewImp *pImp; // Hier Meldet sich der Idler an und ab.
+ SwCntntNode *pCntntNode; // Hier wird die aktuelle Cursorposition
+ xub_StrLen nTxtPos; // zwischengespeichert.
+ BOOL bPageValid; // Konnte die Seite alles validiert werden?
+ BOOL bAllValid; // Konnte alles validiert werden?
+
+#ifdef DBG_UTIL
+ BOOL bIndicator;
+#endif
+
+#ifdef _LAYACT_CXX
+
+#ifdef DBG_UTIL
+ void ShowIdle( ColorData eName );
+#endif
+
+ BOOL _CollectAutoCmplWords( const SwCntntFrm *, BOOL bOnlyVisArea );
+ BOOL CollectAutoCmplWords( BOOL );
+
+#endif
+
+public:
+ SwLayIdle( SwRootFrm *pRt, SwViewImp *pImp );
+ ~SwLayIdle();
+};
+
+inline void SwLayAction::SetCheckPageNum( USHORT nNew )
+{
+ if ( nNew < nCheckPageNum )
+ nCheckPageNum = nNew;
+}
+
+} //namespace binfilter
+#endif //_LAYACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/laycache.hxx b/binfilter/bf_sw/source/core/inc/laycache.hxx
new file mode 100644
index 000000000000..0945baabc39b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/laycache.hxx
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _LAYCACHE_HXX
+#define _LAYCACHE_HXX
+namespace binfilter {
+
+
+class SwDoc;
+class SwLayCacheImpl;
+
+/*************************************************************************
+ * class SwLayoutCache
+ *
+ * This class allows to save layout information in the file and it contains
+ * this information after loading of a file.
+ * Call Write(..) with a stream and the document to save and the page break
+ * information of the document will be written.
+ * Call Read(..) with a stream and the member pLayCacheImpl will
+ * read the information from the stream and store it in an internal structur.
+ * There's a simple locking mechanism at these classes,
+ * if somebody reads the information, he increments the lock count by 1,
+ * during the Read(..) function the lock count will set to $8000.
+ *
+ **************************************************************************/
+
+class SwLayoutCache
+{
+ SwLayCacheImpl *pImpl;
+ USHORT nLockCount;
+public:
+ SwLayoutCache() : pImpl( NULL ), nLockCount( 0 ) {}
+ ~SwLayoutCache();
+
+ void Read( SvStream &rStream );
+ void Write( SvStream &rStream, const SwDoc& rDoc );
+
+ void ClearImpl();
+ sal_Bool IsLocked() const { return nLockCount > 0; }
+ USHORT& GetLockCount() { return nLockCount; }
+ SwLayCacheImpl *LockImpl()
+ { if( nLockCount & 0x8000 ) return NULL;
+ if ( pImpl )
+ ++nLockCount;
+ return pImpl; }
+ void UnlockImpl() { --nLockCount; }
+
+#ifdef DBG_UTIL
+#endif
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/layfrm.hxx b/binfilter/bf_sw/source/core/inc/layfrm.hxx
new file mode 100644
index 000000000000..ab6861558be9
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/layfrm.hxx
@@ -0,0 +1,184 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _LAYFRM_HXX
+#define _LAYFRM_HXX
+
+#include "frame.hxx"
+namespace binfilter {
+
+class SwCntntFrm;
+class SwFlowFrm;
+class SwFmtCol;
+struct SwCrsrMoveState;
+class SwFrmFmt;
+class SwBorderAttrs;
+class SwFmtFrmSize;
+class SwCellFrm;
+
+class SwLayoutFrm: public SwFrm
+{
+ //Der verkappte SwFrm
+ friend class SwFlowFrm;
+ friend class SwFrm;
+
+ //Hebt die Lower waehrend eines Spaltenumbaus auf.
+ friend SwFrm* SaveCntnt( SwLayoutFrm *, SwFrm * );
+ friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling );
+
+ //entfernt leere SwSectionFrms aus einer Kette
+ friend SwFrm* SwClearDummies( SwFrm* pFrm );
+
+ void CopySubtree( const SwLayoutFrm *pDest );
+protected:
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void MakeAll();
+
+ SwFrm *pLower;
+
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+
+ long CalcRel( const SwFmtFrmSize &rSz, BOOL bWidth ) const;
+
+public:
+ void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
+
+ //Proportionale Groessenanpassung der untergeordneten.
+ void ChgLowersProp( const Size& rOldSize );
+
+ void AdjustColumns( const SwFmtCol *pCol, BOOL bAdjustAttributes,
+ BOOL bAutoWidth = FALSE);
+
+ void ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
+ const BOOL bChgFtn = FALSE );
+
+
+ //Painted die Column-Trennlinien fuer die innenliegenden Columns.
+
+
+ virtual void Cut();
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+
+ //sucht den dichtesten Cntnt zum SPoint, wird bei Seiten, Flys und Cells
+ //benutzt wenn GetCrsrOfst versagt hat.
+ const SwCntntFrm* GetCntntPos( Point &rPoint, const BOOL bDontLeave,
+ const BOOL bBodyOnly = FALSE,
+ const BOOL bCalc = FALSE,
+ const SwCrsrMoveState *pCMS = 0,
+ const BOOL bDefaultExpand = TRUE ) const;
+
+ SwLayoutFrm( SwFrmFmt* );
+ ~SwLayoutFrm();
+
+ const SwFrm *Lower() const { return pLower; }
+ SwFrm *Lower() { return pLower; }
+ const SwCntntFrm *ContainsCntnt() const;
+ inline SwCntntFrm *ContainsCntnt();
+ const SwCellFrm *FirstCell() const;
+ inline SwCellFrm *FirstCell();
+ const SwFrm *ContainsAny() const;
+ inline SwFrm *ContainsAny();
+ BOOL IsAnLower( const SwFrm * ) const;
+
+ const SwFrmFmt *GetFmt() const { return (const SwFrmFmt*)GetDep(); }
+ SwFrmFmt *GetFmt() { return (SwFrmFmt*)GetDep(); }
+ void SetFrmFmt( SwFrmFmt* );
+
+ //Verschieben der Ftns aller Lower - ab dem StartCntnt.
+ //TRUE wenn mindestens eine Ftn verschoben wurde.
+ //Ruft das Update der Seitennummer wenn bFtnNums gesetzt ist.
+ BOOL MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
+ SwFtnBossFrm *pNewBoss, const BOOL bFtnNums );
+
+ //Sorgt dafuer, dass innenliegende Flys noetigenfalls zum clippen bzw.
+ //reformatieren invalidiert werden.
+ void NotifyFlys();
+
+ //Invalidiert diejenigen innenliegenden Frames, deren Breite und/oder
+ //Hoehe Prozentual berechnet werden. Auch Rahmen, die an this oder an
+ //innenliegenden verankert sind werden ggf. invalidiert.
+ void InvaPercentLowers( SwTwips nDiff = 0 );
+
+ //Gerufen von Format fuer Rahmen und Bereichen mit Spalten.
+ void FormatWidthCols( const SwBorderAttrs &, const SwTwips nBorder,
+ const SwTwips nMinHeight );
+
+ // InnerHeight returns the height of the content and may be bigger or
+ // less than the PrtArea-Height of the layoutframe himself
+ SwTwips InnerHeight() const;
+
+ /** method to check relative position of layout frame to
+ a given layout frame.
+
+ OD 08.11.2002 - refactoring of pseudo-local method <lcl_Apres(..)> in
+ <txtftn.cxx> for #104840#.
+
+ @param _aCheckRefLayFrm
+ constant reference of an instance of class <SwLayoutFrm> which
+ is used as the reference for the relative position check.
+
+ @author OD
+
+ @return true, if <this> is positioned before the layout frame <p>
+ */
+ bool IsBefore( const SwLayoutFrm* _pCheckRefLayFrm ) const;
+};
+
+//Um doppelte Implementierung zu sparen wird hier ein bischen gecasted
+inline SwCntntFrm* SwLayoutFrm::ContainsCntnt()
+{
+ return (SwCntntFrm*)(((const SwLayoutFrm*)this)->ContainsCntnt());
+}
+
+inline SwCellFrm* SwLayoutFrm::FirstCell()
+{
+ return (SwCellFrm*)(((const SwLayoutFrm*)this)->FirstCell());
+}
+
+inline SwFrm* SwLayoutFrm::ContainsAny()
+{
+ return (SwFrm*)(((const SwLayoutFrm*)this)->ContainsAny());
+}
+
+// Diese SwFrm-inlines sind hier, damit frame.hxx nicht layfrm.hxx includen muss
+inline BOOL SwFrm::IsColBodyFrm() const
+{
+ return nType == FRMC_BODY && GetUpper()->IsColumnFrm();
+}
+
+inline BOOL SwFrm::IsPageBodyFrm() const
+{
+ return nType == FRMC_BODY && GetUpper()->IsPageFrm();
+}
+
+} //namespace binfilter
+#endif //_LAYFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/layouter.hxx b/binfilter/bf_sw/source/core/inc/layouter.hxx
new file mode 100644
index 000000000000..bf5bde68ebfd
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/layouter.hxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _LAYOUTER_HXX
+#define _LAYOUTER_HXX
+
+#include "swtypes.hxx"
+namespace binfilter {
+
+class SwDoc;
+class SwSectionFrm;
+class SwFtnFrm;
+class SwPageFrm;
+class SwLooping;
+
+#define LOOP_PAGE 1
+
+class SwLayouter
+{
+ SwLooping* pLooping;
+ BOOL StartLooping( SwPageFrm* pPage );
+public:
+ SwLayouter();
+ ~SwLayouter();
+
+ void LoopControl( SwPageFrm* pPage, BYTE nLoop );
+ void EndLoopControl();
+
+ static BOOL StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage );
+};
+
+} //namespace binfilter
+#endif //_LAYOUTER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/mvsave.hxx b/binfilter/bf_sw/source/core/inc/mvsave.hxx
new file mode 100644
index 000000000000..73586a0d8daa
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/mvsave.hxx
@@ -0,0 +1,212 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _MVSAVE_HXX
+#define _MVSAVE_HXX
+
+
+#include <tools/string.hxx>
+#include <vcl/keycod.hxx>
+#include <bf_svtools/svarray.hxx>
+namespace binfilter {
+class SvULongs;
+
+class SvNumberFormatter;
+
+class SwBookmark;
+class SwDoc;
+class SwFmtAnchor;
+class SwFrmFmt;
+class SwIndex;
+class SwNodeIndex;
+class SwNodeRange;
+class SwPaM;
+class SwRedline;
+struct SwPosition;
+
+enum SaveBookmarkType { BKMK_POS_NONE = 0x00,
+ BKMK_POS = 0x01,
+ BKMK_POS_OTHER = 0x02
+ };
+
+class SaveBookmark
+{
+ String aName, aShortName;
+ ULONG nNode1, nNode2;
+ xub_StrLen nCntnt1, nCntnt2;
+ KeyCode aCode;
+ SaveBookmarkType eBkmkType;
+ BOOKMARK_TYPE eOrigBkmType;
+
+public:
+ SaveBookmark( int, const SwBookmark&, const SwNodeIndex&,
+ const SwIndex* pIdx = 0 );
+};
+
+SV_DECL_PTRARR_DEL( SaveBookmarks, SaveBookmark*, 0, 10 )
+
+void _DelBookmarks( const SwNodeIndex& rStt,
+ const SwNodeIndex& rEnd,
+ SaveBookmarks* pSaveBkmk = 0,
+ const SwIndex* pSttIdx = 0,
+ const SwIndex* pEndIdx = 0 );
+
+
+#define SAVEFLY 1
+#define SAVEFLY_SPLIT 2
+
+void _SaveCntntIdx( SwDoc* pDoc, ULONG nNode, xub_StrLen nCntnt,
+ SvULongs& rSaveArr, BYTE nSaveFly = 0 );
+void _RestoreCntntIdx( SwDoc* pDoc, SvULongs& rSaveArr,
+ULONG nNode, xub_StrLen nOffset = 0,
+BOOL bAuto = FALSE );
+
+
+/** data structure to temporarily hold fly anchor positions relative to some
+ * location. */
+struct _SaveFly
+{
+ ULONG nNdDiff; /// relative node difference
+ SwFrmFmt* pFrmFmt; /// the fly's frame format
+ sal_Bool bInsertPosition; /// if true, anchor _at_ insert position
+
+ _SaveFly( ULONG nNodeDiff, SwFrmFmt* pFmt, sal_Bool bInsert )
+ : nNdDiff( nNodeDiff ), pFrmFmt( pFmt ), bInsertPosition( bInsert )
+ { }
+};
+
+SV_DECL_VARARR( _SaveFlyArr, _SaveFly, 0, 10 )
+
+
+void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
+ const SwNodeIndex& rPtNdIdx );
+
+
+class SwDataChanged
+{
+ const SwPaM* pPam;
+ const SwPosition* pPos;
+ SwDoc* pDoc;
+ ULONG nNode;
+ xub_StrLen nCntnt;
+ USHORT nType; // Insert/Move/Delete/... (UndoIds)
+
+public:
+ SwDataChanged( const SwPaM& rPam, USHORT nType );
+ SwDataChanged( SwDoc* pDoc, const SwPosition& rPos, USHORT nType );
+ ~SwDataChanged();
+
+ ULONG GetNode() const { return nNode; }
+ xub_StrLen GetCntnt() const { return nCntnt; }
+};
+
+
+// Funktions-Deklaration damit auch alles unter der CrsrShell mal die
+// Crsr verschieben kann
+// die Funktionen rufen nicht die SwDoc::Corr - Methoden!
+
+ // Setzt alle PaMs an OldPos auf NewPos + Offset
+void PaMCorrAbs( const SwPosition &rOldPos,
+ const SwPosition &rNewPos,
+ const xub_StrLen nOffset = 0 );
+
+ // Setzt alle PaMs in OldNode auf NewPos + Offset
+void PaMCorrAbs( const SwNodeIndex &rOldNode,
+ const SwPosition &rNewPos,
+ const xub_StrLen nOffset = 0 );
+
+ // Setzt alle PaMs im Bereich vom Range nach NewPos
+void PaMCorrAbs( const SwPaM& rRange,
+ const SwPosition& rNewPos );
+
+ // Setzt alle PaMs im Bereich von [StartNode, EndNode] nach NewPos
+void PaMCorrAbs( const SwNodeIndex &rStartNode,
+ const SwNodeIndex &rEndNode,
+ const SwPosition &rNewPos );
+
+ // Setzt alle PaMs in OldNode auf relative Pos
+void PaMCorrRel( const SwNodeIndex &rOldNode,
+ const SwPosition &rNewPos,
+ const xub_StrLen nOffset = 0 );
+
+
+// Hilfsklasse zum kopieren von absatzgebundenen Flys. Durch die Sortierung
+// nach der Ordnungsnummer wird versucht die layout seitige Anordnung
+// bei zu behalten
+class _ZSortFly
+{
+ const SwFrmFmt* pFmt;
+ const SwFmtAnchor* pAnchor;
+ UINT32 nOrdNum;
+
+public:
+ _ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAnchor,
+ UINT32 nArrOrdNum );
+ _ZSortFly& operator=( const _ZSortFly& rCpy )
+ {
+ pFmt = rCpy.pFmt, pAnchor = rCpy.pAnchor, nOrdNum = rCpy.nOrdNum;
+ return *this;
+ }
+
+ int operator==( const _ZSortFly& ) const { return FALSE; }
+ int operator<( const _ZSortFly& rCmp ) const
+ { return nOrdNum < rCmp.nOrdNum; }
+
+ const SwFrmFmt* GetFmt() const { return pFmt; }
+ const SwFmtAnchor* GetAnchor() const { return pAnchor; }
+};
+
+SV_DECL_VARARR_SORT( _ZSortFlys, _ZSortFly, 0, 10 )
+
+
+class SwTblNumFmtMerge
+{
+ SvNumberFormatter* pNFmt;
+public:
+ SwTblNumFmtMerge( const SwDoc& rSrc, SwDoc& rDest );
+ ~SwTblNumFmtMerge();
+};
+
+
+class _SaveRedlEndPosForRestore
+{
+ SvPtrarr* pSavArr;
+ SwNodeIndex* pSavIdx;
+
+ void _Restore();
+public:
+ _SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx );
+ ~_SaveRedlEndPosForRestore();
+ void Restore() { if( pSavArr ) _Restore(); }
+};
+
+
+} //namespace binfilter
+#endif // _MVSAVE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/node2lay.hxx b/binfilter/bf_sw/source/core/inc/node2lay.hxx
new file mode 100644
index 000000000000..065c4cd1f188
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/node2lay.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _NODE2LAY_HXX
+#define _NODE2LAY_HXX
+namespace binfilter {
+
+/* -----------------23.02.99 11:33-------------------
+ * Die Klasse SwNode2Layout stellt die Verbindung von Nodes zum Layout her.
+ * Sie liefert einen intelligenten Iterator ueber die zum Node oder Nodebereich
+ * gehoerenden Frames. Je nach Zweck der Iteration, z.B. um vor oder hinter
+ * den Frames andere Frames einzufuegen, werden Master/Follows erkannt und nur
+ * die relevanten zurueckgegeben. Auch wiederholte Tabellenueberschriften werden
+ * beachtet.
+ * Es ist auch moeglich, ueber SectionNodes zu iterieren, die durch Schachtelung
+ * manchmal gar keinem SectionFrm direkt zugeordnet sind, manchmal aber sogar
+ * mehreren.
+ * SwNode2Layout ist ein Schnittstelle zwischen der aufrufenden Methode und
+ * einem SwClientIter, sie waehlt je nach Aufgabenstellung das richtige
+ * SwModify aus, erzeugt einen SwClientIter und filtert dessen Iterationen
+ * je nach Aufgabenstellung.
+ * Die Aufgabenstellung wird durch die Wahl des Ctors bestimmt.
+ * 1. Das Einsammeln der UpperFrms, damit spaeter RestoreUpperFrms wird,
+ * wird von MakeFrms gerufen, wenn es keinen PrevNext gibt, vor/hinter den
+ * die Frames gehaengt werden koennen.
+ * 2. Die Lieferung der Frames hinter/vor die die neuen Frames eines Nodes
+ * gehaengt werden muessen, ebenfalls von MakeFrms gerufen.
+ * --------------------------------------------------*/
+
+class SwNode2LayImpl;
+class SwFrm;
+class SwLayoutFrm;
+class SwNode;
+
+class SwNode2Layout
+{
+ SwNode2LayImpl *pImpl;
+public:
+ // Dieser Ctor ist zum Einsammeln der UpperFrms gedacht.
+ SwNode2Layout( const SwNode& rNd );
+ // Dieser Ctor ist fuer das Einfuegen vor oder hinter rNd gedacht,
+ // nIdx ist der Index des einzufuegenden Nodes
+ SwNode2Layout( const SwNode& rNd, ULONG nIdx );
+ ~SwNode2Layout();
+ SwFrm* NextFrm();
+ SwLayoutFrm* UpperFrm( SwFrm* &rpFrm, const SwNode& rNode );
+ void RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd );
+
+ SwFrm *GetFrm( const Point* pDocPos = 0,
+ const SwPosition *pPos = 0,
+ const BOOL bCalcFrm = TRUE ) const;
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/noteurl.hxx b/binfilter/bf_sw/source/core/inc/noteurl.hxx
new file mode 100644
index 000000000000..ab3b033297a0
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/noteurl.hxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _NOTEURL_HXX
+#define _NOTEURL_HXX
+
+
+#include <bf_svtools/svarray.hxx>
+#include <tools/string.hxx>
+#include "swrect.hxx"
+class MapMode;
+
+namespace binfilter {
+
+class ImageMap;
+
+class SwURLNote
+{
+ String aURL;
+ String aTarget;
+ SwRect aRect;
+public:
+ SwURLNote( const String& rURL, const String& rTarget, const SwRect& rRect )
+ : aURL( rURL ), aTarget( rTarget ), aRect( rRect )
+ {}
+ const String& GetURL() const { return aURL; }
+ const String& GetTarget() const { return aTarget; }
+ const SwRect& GetRect() const { return aRect; }
+ BOOL operator==( const SwURLNote& rSwURLNote ) const
+ { return aRect == rSwURLNote.aRect; }
+};
+
+typedef SwURLNote* SwURLNotePtr;
+SV_DECL_PTRARR_DEL(SwURLNoteList, SwURLNotePtr, 0, 5)
+
+class SwNoteURL
+{
+ SwURLNoteList aList;
+public:
+ SwNoteURL() {}
+ USHORT Count() const { return aList.Count(); }
+ const SwURLNote& GetURLNote( USHORT nPos ) const
+ { return *aList.GetObject( nPos ); }
+};
+
+// globale Variable, in NoteURL.Cxx angelegt
+extern SwNoteURL *pNoteURL;
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/notxtfrm.hxx b/binfilter/bf_sw/source/core/inc/notxtfrm.hxx
new file mode 100644
index 000000000000..7fee828d8036
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/notxtfrm.hxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _NOTXTFRM_HXX
+#define _NOTXTFRM_HXX
+
+#include <cntfrm.hxx>
+class OutputDevice;
+class Bitmap;
+namespace binfilter {
+
+class SwNoTxtNode;
+
+class SwBorderAttrs;
+
+struct SwCrsrMoveState;
+
+class SwNoTxtFrm: public SwCntntFrm
+{
+ friend void _FrmFinit(); //erase pErrorBmp and pReplaceBmp
+ static Bitmap *pErrorBmp, *pReplaceBmp;
+
+ short nWeight; // "Wichtigkeit" der Grafik
+
+ const Size& GetSize() const;
+
+ void InitCtor();
+
+ void Format ( const SwBorderAttrs *pAttrs = 0 );
+ void PaintCntnt ( OutputDevice*, const SwRect&, const SwRect& ) const;
+ /// OD 25.09.2002 #99739# - delete unused 3rd parameter
+ void PaintPicture( OutputDevice*, const SwRect& ) const;
+protected:
+ virtual void MakeAll();
+public:
+ SwNoTxtFrm( SwNoTxtNode * const );
+ ~SwNoTxtFrm();
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Paint(const SwRect& ) const;
+ virtual BOOL GetCharRect( SwRect &, const SwPosition&,
+ SwCrsrMoveState* = 0) const;
+ BOOL GetCrsrOfst(SwPosition* pPos, Point& aPoint,
+ const SwCrsrMoveState* = 0) const;
+
+ const Size &GetGrfSize() const { return GetSize(); }
+ void GetGrfArea( SwRect &rRect, SwRect * = 0, BOOL bMirror = TRUE ) const;
+
+ void StopAnimation( OutputDevice* = 0 ) const;
+ BOOL HasAnimation() const;
+
+ // Routinen fuer den Grafik-Cache
+ USHORT GetWeight() { return nWeight; }
+
+ static const Bitmap& GetBitmap( BOOL bError );
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/numpara.hxx b/binfilter/bf_sw/source/core/inc/numpara.hxx
new file mode 100644
index 000000000000..75d6f9b74590
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/numpara.hxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _NUMPARA_HXX
+#define _NUMPARA_HXX
+
+#include "numrule.hxx"
+#include "ndarr.hxx"
+#include "ndindex.hxx"
+namespace binfilter {
+
+class SwTxtNode;
+class SwDoc;
+class SwNumSection;
+class SwNodes;
+
+class _NumPara
+{
+ const SwNumSection& rNumSection;
+
+ void _Init();
+
+public:
+ SwNodeIndex aNdIdx;
+ ULONG nCnt;
+ SwNum aNum;
+ char nDiff; // +1, 0, -1 !! dafuer reicht ein char !!
+ BYTE nOldLevel;
+ BOOL bInitNum : 1;
+ BOOL bWasUndo : 1;
+ BOOL bOverTbl : 1; // Flag fuer ForEach-Methoden, Tabelle ueberspr.
+
+ _NumPara( char nOffset, const SwNodeIndex& rNdIdx,
+ const SwNumSection& rSect, ULONG nCntNodes );
+ _NumPara( const SwNodeIndex& rNdIdx, const SwNumSection& rSect );
+ ~_NumPara();
+
+ void UpdateNum( SwTxtNode& rTxtNd );
+};
+
+// Funktion fuer ForEach am Nodes-Array
+BOOL _NumUpDown( const SwNodePtr& rpNode, void* pPara );
+
+
+} //namespace binfilter
+#endif // _NUMPARA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/pagefrm.hxx b/binfilter/bf_sw/source/core/inc/pagefrm.hxx
new file mode 100644
index 000000000000..e9da3a99f9de
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/pagefrm.hxx
@@ -0,0 +1,435 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _PAGEFRM_HXX
+#define _PAGEFRM_HXX
+
+
+
+#include <bf_svtools/svarray.hxx>
+
+#include "ftnboss.hxx"
+
+#include <tools/mempool.hxx>
+namespace binfilter {
+
+class SvPtrarr;
+class SwFlyFrm;
+class SwFrmFmt;
+class SwPageDesc;
+class SwCntntFrm;
+struct SwPosition;
+struct SwCrsrMoveState;
+class SwFmtAnchor;
+class SdrObject;
+class SwDrawContact;
+class SwAttrSetChg;
+
+
+SV_DECL_PTRARR_SORT(SwSortDrawObjs,SdrObjectPtr,1,2)//STRIP008 ;
+
+enum SwPageChg
+{
+ CHG_NEWPAGE,
+ CHG_CUTPAGE,
+ CHG_CHGPAGE
+};
+
+void SetLastPage( SwPageFrm* );
+
+class SwPageFrm: public SwFtnBossFrm
+{
+ friend class SwFrm;
+
+ //Array fuer die Draw-Objekte auf der Seite.
+ //Das Sortierte Array ist nach den Pointeraddressen sortiert.
+ //Die Objs in dem Array haben ihren Anker nicht notwendigerweise auf
+ //der Seite.
+ SwSortDrawObjs *pSortedObjs;
+
+ SwPageDesc *pDesc; //PageDesc der die Seite beschreibt.
+
+ USHORT nPhyPageNum; //Physikalische Seitennummer.
+
+ BOOL bInvalidCntnt :1;
+ BOOL bInvalidLayout :1;
+ BOOL bInvalidFlyCntnt :1;
+ BOOL bInvalidFlyLayout :1;
+ BOOL bInvalidFlyInCnt :1;
+ BOOL bFtnPage :1; //Diese Seite ist fuer Dokumentende-Fussnoten.
+ BOOL bEmptyPage :1; //Dies ist eine explizite Leerseite
+ BOOL bInvalidSpelling :1; //Das Online-Spelling ist gefordert
+ BOOL bEndNotePage :1; //'Fussnotenseite' fuer Endnoten
+ BOOL bInvalidAutoCmplWrds :1; //Auto-Complete Wordliste aktualisieren
+#ifdef VERTICAL_LAYOUT
+ BOOL bHasGrid :1; // Grid for Asian layout
+#endif
+
+ // OD 12.02.2003 #i9719#, #105645#
+ static const sal_Int8 mnBorderPxWidth;
+ static const sal_Int8 mnShadowPxWidth;
+
+ //Anpassung der RootSize und Benachrichtigungen beim Einsetzen,
+ //Entfernen und Groessenaenderungen der Seite.
+ void AdjustRootSize( const SwPageChg eChgType, const SwRect *pOld );
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+
+ // Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
+
+ /** determine rectangle for page border
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ @author OD
+
+ @param _rPageRect
+ input parameter - constant instance reference of the page rectangle.
+ Generally, it's the frame area of the page, but for empty pages in print
+ preview, this parameter is useful.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, for which the rectangle
+ has to be generated.
+
+ @param _orBorderRect
+ output parameter - instance reference of the border rectangle for
+ the given page rectangle
+ */
+ void GetBorderRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBorderRect ) const;
+
+ /** determine rectangle for right page shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ @author OD
+
+ @param _rPageRect
+ input parameter - constant instance reference of the page rectangle.
+ Generally, it's the frame area of the page, but for empty pages in print
+ preview, this parameter is useful.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, for which the rectangle
+ has to be generated.
+
+ @param _orRightShadowRect
+ output parameter - instance reference of the right shadow rectangle for
+ the given page rectangle
+ */
+ void GetRightShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orRightShadowRect ) const;
+
+ /** determine rectangle for bottom page shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ @author OD
+
+ @param _rPageRect
+ input parameter - constant instance reference of the page rectangle.
+ Generally, it's the frame area of the page, but for empty pages in print
+ preview, this parameter is useful.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, for which the rectangle
+ has to be generated.
+
+ @param _orBottomShadowRect
+ output parameter - instance reference of the bottom shadow rectangle for
+ the given page rectangle
+ */
+ void GetBottomShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBottomShadowRect ) const;
+
+protected:
+ virtual void MakeAll();
+
+public:
+ DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
+
+ SwPageFrm( SwFrmFmt*, SwPageDesc* );
+ ~SwPageFrm();
+
+ //public, damit die ViewShell beim Umschalten vom BrowseMode darauf
+ //zugreifen kann.
+ void PrepareHeader(); //Kopf-/Fusszeilen anlegen/entfernen.
+ void PrepareFooter();
+
+ const SwSortDrawObjs *GetSortedObjs() const { return pSortedObjs; }
+ SwSortDrawObjs *GetSortedObjs() { return pSortedObjs; }
+
+ void AppendDrawObj( SwDrawContact *pNew );
+ void RemoveDrawObj( SwDrawContact *pToRemove );
+ // OD 20.05.2003 #108784# - <AppendDrawObj>/<RemoveDrawObj> for virtual drawing objects
+ void AppendVirtDrawObj( SwDrawContact* _pDrawContact,
+ SwDrawVirtObj* _pDrawVirtObj );
+ void RemoveVirtDrawObj( SwDrawContact* _pDrawContact,
+ SwDrawVirtObj* _pDrawVirtObj );
+
+ void AppendFly( SwFlyFrm *pNew );
+ void RemoveFly( SwFlyFrm *pToRemove );
+ void MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest );//optimiertes Remove/Append
+
+ void SetPageDesc( SwPageDesc *, SwFrmFmt * );
+ SwPageDesc *GetPageDesc() { return pDesc; }
+ const SwPageDesc *GetPageDesc() const { return pDesc; }
+ SwPageDesc *FindPageDesc();
+
+ SwCntntFrm *FindLastBodyCntnt();
+ inline SwCntntFrm *FindFirstBodyCntnt();
+ inline const SwCntntFrm *FindFirstBodyCntnt() const;
+ inline const SwCntntFrm *FindLastBodyCntnt() const;
+
+ //Spezialisiertes GetCntntPos() fuer Felder in Rahmen.
+ void GetCntntPosition( const Point &rPt, SwPosition &rPos ) const;
+
+ BOOL IsEmptyPage() const { return bEmptyPage; } //explizite Leerseite.
+
+ void UpdateFtnNum();
+
+ //Immer nach dem Paste rufen. Erzeugt die Seitengeb. Rahmen und Formatiert
+ //generischen Inhalt.
+ void PreparePage( BOOL bFtn );
+
+ //Schickt an alle ContentFrames ein Prepare wg. geaenderter Registervorlage
+ void PrepareRegisterChg();
+
+ //Haengt einen Fly an den geeigneten LayoutFrm unterhalb der Seite,
+ //fuer SwFEShell und Modify der Flys.
+ SwFrm *PlaceFly( SwFlyFrm *, SwFrmFmt *, const SwFmtAnchor * );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ // erfrage vom Client Informationen
+
+ virtual void Cut();
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+#ifdef VERTICAL_LAYOUT
+ virtual void CheckDirection( BOOL bVert );
+ void CheckGrid( BOOL bInvalidate );
+ BOOL HasGrid() const { return bHasGrid; }
+#endif
+
+ //Zeilennummern usw malen
+
+ //Hilfslinien malen.
+
+ //Fussnotenschnittstelle
+ BOOL IsFtnPage() const { return bFtnPage; }
+ BOOL IsEndNotePage() const { return bEndNotePage; }
+ void SetFtnPage( BOOL b ) { bFtnPage = b; }
+ void SetEndNotePage( BOOL b ) { bEndNotePage = b; }
+
+ inline USHORT GetPhyPageNum() const { return nPhyPageNum;}
+ inline void SetPhyPageNum( USHORT nNum ) { nPhyPageNum = nNum;}
+ inline void DecrPhyPageNum() { --nPhyPageNum; }
+ inline void IncrPhyPageNum() { ++nPhyPageNum; }
+
+ //Validieren, invalidieren und abfragen des Status der Seite.
+ //Layout/Cntnt und jeweils Fly/nicht Fly werden getrennt betrachtet.
+ inline void InvalidateFlyLayout() const;
+ inline void InvalidateFlyCntnt() const;
+ inline void InvalidateFlyInCnt() const;
+ inline void InvalidateLayout() const;
+ inline void InvalidateCntnt() const;
+ inline void InvalidateSpelling() const;
+ inline void InvalidateAutoCompleteWords() const;
+ inline void ValidateFlyLayout() const;
+ inline void ValidateFlyCntnt() const;
+ inline void ValidateFlyInCnt() const;
+ inline void ValidateLayout() const;
+ inline void ValidateCntnt() const;
+ inline void ValidateSpelling() const;
+ inline void ValidateAutoCompleteWords() const;
+ inline BOOL IsInvalid() const;
+ inline BOOL IsInvalidFly() const;
+ BOOL IsInvalidFlyLayout() const { return bInvalidFlyLayout; }
+ BOOL IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; }
+ BOOL IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; }
+ BOOL IsInvalidLayout() const { return bInvalidLayout; }
+ BOOL IsInvalidCntnt() const { return (bInvalidCntnt || bInvalidFlyInCnt); }
+ BOOL IsInvalidSpelling() const { return bInvalidSpelling; }
+ BOOL IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
+
+ /** SwPageFrm::GetDrawBackgrdColor - for #102450#
+
+ 29.08.2002:
+ determine the color, that is respectively will be drawn as background
+ for the page frame.
+
+ @author OD
+
+ @return reference to an instance of class Color
+ */
+ const Color& GetDrawBackgrdColor() const;
+
+ /** paint margin area of a page
+
+ OD 20.11.2002 for #104598#:
+ implement paint of margin area; margin area will be painted for a
+ view shell with a window and if the document is not in online layout.
+
+ @author OD
+
+ @param _rOutputRect
+ input parameter - constant instance reference of the rectangle, for
+ which an output has to be generated.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, on which the output
+ has to be generated.
+ */
+ void PaintMarginArea( const SwRect& _rOutputRect,
+ ViewShell* _pViewShell ) const;
+
+ /** paint page border and shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+ implement paint of page border and shadow
+
+ @author OD
+
+ @param _rPageRect
+ input parameter - constant instance reference of the page rectangle.
+ Generally, it's the frame area of the page, but for empty pages in print
+ preview, this parameter is useful.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, on which the output
+ has to be generated.
+ */
+ void PaintBorderAndShadow( const SwRect& _rPageRect,
+ ViewShell* _pViewShell ) const;
+
+ inline sal_Int8 BorderPxWidth() const
+ {
+ return mnBorderPxWidth;
+ }
+ inline sal_Int8 ShadowPxWidth() const
+ {
+ return mnShadowPxWidth;
+ }
+};
+
+inline SwCntntFrm *SwPageFrm::FindFirstBodyCntnt()
+{
+ SwLayoutFrm *pBody = FindBodyCont();
+ return pBody ? pBody->ContainsCntnt() : 0;
+}
+inline const SwCntntFrm *SwPageFrm::FindFirstBodyCntnt() const
+{
+ const SwLayoutFrm *pBody = FindBodyCont();
+ return pBody ? pBody->ContainsCntnt() : 0;
+}
+inline const SwCntntFrm *SwPageFrm::FindLastBodyCntnt() const
+{
+ return ((SwPageFrm*)this)->FindLastBodyCntnt();
+}
+inline void SwPageFrm::InvalidateFlyLayout() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyLayout = TRUE;
+}
+inline void SwPageFrm::InvalidateFlyCntnt() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyCntnt = TRUE;
+}
+inline void SwPageFrm::InvalidateFlyInCnt() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyInCnt = TRUE;
+}
+inline void SwPageFrm::InvalidateLayout() const
+{
+ ((SwPageFrm*)this)->bInvalidLayout = TRUE;
+}
+inline void SwPageFrm::InvalidateCntnt() const
+{
+ ((SwPageFrm*)this)->bInvalidCntnt = TRUE;
+}
+inline void SwPageFrm::InvalidateSpelling() const
+{
+ ((SwPageFrm*)this)->bInvalidSpelling = TRUE;
+}
+inline void SwPageFrm::InvalidateAutoCompleteWords() const
+{
+ ((SwPageFrm*)this)->bInvalidAutoCmplWrds = FALSE;
+}
+inline void SwPageFrm::ValidateFlyLayout() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyLayout = FALSE;
+}
+inline void SwPageFrm::ValidateFlyCntnt() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyCntnt = FALSE;
+}
+inline void SwPageFrm::ValidateFlyInCnt() const
+{
+ ((SwPageFrm*)this)->bInvalidFlyInCnt = FALSE;
+}
+inline void SwPageFrm::ValidateLayout() const
+{
+ ((SwPageFrm*)this)->bInvalidLayout = FALSE;
+}
+inline void SwPageFrm::ValidateCntnt() const
+{
+ ((SwPageFrm*)this)->bInvalidCntnt = FALSE;
+}
+inline void SwPageFrm::ValidateSpelling() const
+{
+ ((SwPageFrm*)this)->bInvalidSpelling = FALSE;
+}
+inline void SwPageFrm::ValidateAutoCompleteWords() const
+{
+ ((SwPageFrm*)this)->bInvalidAutoCmplWrds = FALSE;
+}
+
+
+inline BOOL SwPageFrm::IsInvalid() const
+{
+ return (bInvalidCntnt || bInvalidLayout || bInvalidFlyInCnt);
+}
+inline BOOL SwPageFrm::IsInvalidFly() const
+{
+ return bInvalidFlyLayout || bInvalidFlyCntnt;
+}
+
+#ifdef VERTICAL_LAYOUT
+#define GETGRID( pPage ) const SwTextGridItem *pGrid = NULL; \
+ {if( pPage && pPage->HasGrid() && GRID_NONE==(pGrid=(SwTextGridItem*)&pPage->\
+ GetPageDesc()->GetMaster().GetAttr(RES_TEXTGRID))->GetGridType() ) \
+ pGrid = NULL;}
+#endif
+
+
+} //namespace binfilter
+#endif //_PAGEFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/pamtyp.hxx b/binfilter/bf_sw/source/core/inc/pamtyp.hxx
new file mode 100644
index 000000000000..02b6b26d4af4
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/pamtyp.hxx
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _PAMTYP_HXX
+#define _PAMTYP_HXX
+
+#include <bf_svtools/txtcmp.hxx>
+#include <pam.hxx>
+#include <node.hxx>
+#include <tools/string.hxx>
+namespace binfilter {
+
+class SwpHints;
+struct SwPosition;
+class SwPaM;
+class SwTxtAttr;
+
+// Funktions-Deklarationen fuer die Move/Find-Methoden vom SwPaM
+
+void GoStartDoc( SwPosition*);
+void GoEndDoc( SwPosition*);
+void GoStartSection( SwPosition*);
+void GoEndSection( SwPosition*);
+FASTBOOL GoInDoc( SwPaM&, SwMoveFn);
+FASTBOOL GoInSection( SwPaM&, SwMoveFn);
+FASTBOOL GoInNode( SwPaM&, SwMoveFn);
+FASTBOOL GoInCntnt( SwPaM&, SwMoveFn);
+FASTBOOL GoInCntntCells( SwPaM&, SwMoveFn);
+const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, USHORT&, xub_StrLen );
+const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, USHORT&, xub_StrLen );
+
+FASTBOOL GoNext(SwNode* pNd, SwIndex * pIdx, USHORT nMode );
+FASTBOOL GoPrevious(SwNode* pNd, SwIndex * pIdx, USHORT nMode );
+SwCntntNode* GoNextNds( SwNodeIndex * pIdx, FASTBOOL );
+SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, FASTBOOL );
+
+// --------- Funktionsdefinitionen fuer die SwCrsrShell --------------
+
+FASTBOOL GoPrevPara( SwPaM&, SwPosPara);
+FASTBOOL GoCurrPara( SwPaM&, SwPosPara);
+FASTBOOL GoNextPara( SwPaM&, SwPosPara);
+FASTBOOL GoPrevSection( SwPaM&, SwPosSection);
+FASTBOOL GoCurrSection( SwPaM&, SwPosSection);
+FASTBOOL GoNextSection( SwPaM&, SwPosSection);
+
+
+// ------------ Typedefiniton fuer Funktionen ----------------------
+
+typedef FASTBOOL (*GoNd)( SwNode*, SwIndex*, USHORT );
+typedef SwCntntNode* (*GoNds)( SwNodeIndex*, FASTBOOL );
+typedef void (*GoDoc)( SwPosition* );
+typedef void (*GoSection)( SwPosition* );
+typedef FASTBOOL (SwPosition:: *CmpOp)( const SwPosition& ) const;
+typedef const SwTxtAttr* (*GetHint)( const SwpHints&, USHORT&, xub_StrLen );
+typedef int (::utl::TextSearch:: *SearchTxt)( const String&, xub_StrLen*,
+ xub_StrLen*, ::com::sun::star::util::SearchResult* );
+typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const;
+
+
+struct SwMoveFnCollection
+{
+ GoNd fnNd;
+ GoNds fnNds;
+ GoDoc fnDoc;
+ GoSection fnSections;
+ CmpOp fnCmpOp;
+ GetHint fnGetHint;
+ SearchTxt fnSearch;
+ MvSection fnSection;
+};
+
+// --------- Funktionsdefinitionen fuers Suchen --------------
+SwCntntNode* GetNode( SwPaM&, FASTBOOL&, SwMoveFn, FASTBOOL bInReadOnly = FALSE );
+
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/prevwpage.hxx b/binfilter/bf_sw/source/core/inc/prevwpage.hxx
new file mode 100644
index 000000000000..8df4f5ec05d4
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/prevwpage.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#ifndef _PREVIEWPAGES_HXX
+#define _PREVIEWPAGES_HXX
+
+// classes <Point>, <Size> and <Rectangle>
+#include <tools/gen.hxx>
+namespace binfilter {
+class SwPageFrm;
+
+/** data structure for a preview page in the current preview layout
+
+ OD 12.12.2002 #103492# - struct <PrevwPage>
+
+ @author OD
+*/
+struct PrevwPage
+{
+ const SwPageFrm* pPage;
+ bool bVisible;
+ Size aPageSize;
+ Point aPrevwWinPos;
+ Point aLogicPos;
+ Point aMapOffset;
+
+ inline PrevwPage();
+};
+
+inline PrevwPage::PrevwPage()
+ : pPage( 0 ),
+ bVisible( false ),
+ aPageSize( Size(0,0) ),
+ aPrevwWinPos( Point(0,0) ),
+ aLogicPos( Point(0,0) ),
+ aMapOffset( Point(0,0) )
+{};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/ptqueue.hxx b/binfilter/bf_sw/source/core/inc/ptqueue.hxx
new file mode 100644
index 000000000000..21fb2ed1254e
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/ptqueue.hxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _PTQUEUE_HXX
+#define _PTQUEUE_HXX
+namespace binfilter {
+
+//Leider vertragen wir es nicht so gut, wenn wir mehr als ein Paint
+//gleichzeitig verarbeiten sollen. Insbesondere beim Drucken kommt dies
+//leider haeufig vor.
+//SwRootFrm::Paint() stellt fest, dass es zum zweitenmal gerufen wird, und
+//traegt das Rechteck sowie die dazugehoerige Shell in den PaintCollector ein.
+//Diejenigen stellen, die moeglicherweise das doppelte Paint "Verursachen"
+//brauchen nur noch zum richtigen Zeitpunkt die gesammelten Paints verarbeiten.
+//Derzeit bietet sich der Druckvorgang an, und zwar nach dem Druck von jeweils
+//einer Seite.
+
+//Das Invalidieren der Windows direkt aus dem RootFrm::Paint hat sich als nicht
+//erfolgreich erwiesen, weil die Paints dann in den allermeisten Faellen
+//wiederum zu einem sehr unguenstigen Zeitpunkt ankommen.
+//Nach dem Druck jeder Seite ein Update auf alle Fenster auszuloesen scheint
+//auch nicht angeraten, weil einerseits die edit-Windows nicht im direkten
+//Zugriff sind und anderseits das notwendige Update je nach Plattform extrem
+//teuer werden kann.
+
+class SwQueuedPaint;
+class ViewShell;
+class SwRect;
+
+class SwPaintQueue
+{
+public:
+ static SwQueuedPaint *pQueue;
+
+ static void Remove( ViewShell *pSh );
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/rootfrm.hxx b/binfilter/bf_sw/source/core/inc/rootfrm.hxx
new file mode 100644
index 000000000000..bf5d8af13b69
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/rootfrm.hxx
@@ -0,0 +1,325 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _ROOTFRM_HXX
+#define _ROOTFRM_HXX
+
+#include "layfrm.hxx"
+class OutputDevice;
+namespace binfilter {
+
+class SwCntntFrm;
+class ViewShell;
+class SdrPage;
+class SwFrmFmt;
+class SwPaM;
+class SwCursor;
+class SwShellCrsr;
+class SwTableCursor;
+class SwRegionRects;
+
+class SwLayVout;
+class SwDestroyList;
+class SwCurrShells;
+struct SwPosition;
+struct SwCrsrMoveState;
+
+#define HACK_TABLEMODE_INIT 0
+#define HACK_TABLEMODE_LOCKLINES 1
+#define HACK_TABLEMODE_PAINTLINES 2
+#define HACK_TABLEMODE_UNLOCKLINES 3
+#define HACK_TABLEMODE_EXIT 4
+
+#define INV_SIZE 1
+#define INV_PRTAREA 2
+#define INV_POS 4
+#define INV_TABLE 8
+#define INV_SECTION 16
+#define INV_LINENUM 32
+#define INV_DIRECTION 64
+
+class SwRootFrm: public SwLayoutFrm
+{
+ //Muss das Superfluous temporaer abschalten.
+ friend void AdjustSizeChgNotify( SwRootFrm *pRoot );
+
+ //Pflegt pLastPage (Cut() und Paste() vom SwPageFrm
+ friend inline void SetLastPage( SwPageFrm* );
+
+ // Fuer das Anlegen und Zerstoeren des virtuellen Outputdevice-Managers
+ friend void _FrmInit(); //erzeugt pVout
+ friend void _FrmFinit(); //loescht pVout
+
+ static SwLayVout *pVout;
+ static BOOL bInPaint; //Schutz gegen doppelte Paints.
+ static BOOL bNoVirDev; //Bei SystemPaints kein virt. Device
+
+ BOOL bCheckSuperfluous :1; //Leere Seiten suchen?
+ BOOL bIdleFormat :1; //Idle-Formatierer anwerfen?
+ BOOL bBrowseWidthValid :1; //Ist nBrowseWidth gueltig?
+ BOOL bDummy2 :1; //Unbenutzt
+ BOOL bTurboAllowed :1;
+ BOOL bAssertFlyPages :1; //Ggf. weitere Seiten fuer Flys einfuegen?
+ BOOL bDummy :1; //Unbenutzt
+ BOOL bIsVirtPageNum :1; //gibt es eine virtuelle Seitennummer ?
+ BOOL bIsNewLayout :1; //Layout geladen oder neu erzeugt.
+ BOOL bCallbackActionEnabled:1; //Keine Action in Benachrichtung erwuenscht
+ //siehe dcontact.cxx, ::Changed()
+
+ //Fuer den BrowseMode. nBrowseWidth ist die Aeussere Kante des am weitesten
+ //rechts stehenden Objectes. Die rechte Kante der Seiten soll im BrowseMode
+ //nicht kleiner werden als dieser Wert.
+ long nBrowseWidth;
+
+ //Wenn nur _ein: CntntFrm zu formatieren ist, so steht dieser in pTurbo.
+ const SwCntntFrm *pTurbo;
+
+ //Die letzte Seite wollen wir uns nicht immer muehsam zusammensuchen.
+ SwPageFrm *pLastPage;
+
+ //Die Root kuemmert sich nun auch um den Shell-Zugriff. Ueber das Dokument
+ //sollte man auch immer an die Root herankommen und somit auch immer
+ //einen Zugriff auf die Shell haben.
+ //Der Pointer pCurrShell ist der Pointer auf irgendeine der Shells fuer
+ //das Dokument
+ //Da es durchaus nicht immer egal ist, auf welcher Shell gearbeitet wird,
+ //ist es notwendig die aktive Shell zu kennen. Das wird dadurch angenaehert,
+ //dass der Pointer pCurrShell immer dann umgesetzt wird, wenn eine
+ //Shell den Fokus erhaelt (FEShell). Zusaetzlich wird der Pointer
+ //Temporaer von SwCurrShell umgesetzt, dieses wird typischerweise
+ //ueber das Macro SET_CURR_SHELL erledigt. Makro + Klasse sind in der
+ //ViewShell zu finden. Diese Objekte koennen auch verschachtelt (auch fuer
+ //unterschiedliche Shells) erzeugt werden. Sie werden im Array pCurrShells
+ //gesammelt.
+ //Weiterhin kann es noch vorkommen, dass eine Shell aktiviert wird,
+ //waehrend noch ein CurrShell-Objekt "aktiv" ist. Dieses wird dann in
+ //pWaitingCurrShell eingetragen und vom letzten DTor der CurrShell
+ //"aktiviert".
+ //Ein weiteres Problem ist dass Zerstoeren einer Shell waehrend sie aktiv
+ //ist. Der Pointer pCurrShell wird dann auf eine beliebige andere Shell
+ //umgesetzt.
+ //Wenn zum Zeitpunkt der zerstoerung einer Shell diese noch in irgendwelchen
+ //CurrShell-Objekten referenziert wird, so wird auch dies aufgeklart.
+ friend class CurrShell;
+ friend void InitCurrShells( SwRootFrm *pRoot );
+ ViewShell *pCurrShell;
+ ViewShell *pWaitingCurrShell;
+ SwCurrShells *pCurrShells;
+
+ //Eine Page im DrawModel pro Dokument, hat immer die Groesse der Root.
+ SdrPage *pDrawPage;
+
+ SwDestroyList* pDestroy;
+
+ USHORT nPhyPageNums; //Anzahl der Seiten.
+#ifdef ACCESSIBLE_LAYOUT
+ sal_uInt16 nAccessibleShells; // Number of accessible shells
+#endif
+
+ void ImplCalcBrowseWidth();
+ void ImplInvalidateBrowseWidth();
+
+ void _DeleteEmptySct(); // zerstoert ggf. die angemeldeten SectionFrms
+ void _RemoveFromList( SwSectionFrm* pSct ); // entfernt SectionFrms aus der Delete-Liste
+
+protected:
+
+ virtual void MakeAll();
+
+public:
+
+ //MasterObjekte aus der Page entfernen (von den Ctoren gerufen).
+ static void RemoveMasterObjs( SdrPage *pPg );
+
+ //Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen)
+ //Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird
+
+ SwRootFrm( SwFrmFmt*, ViewShell* );
+ ~SwRootFrm();
+
+ ViewShell *GetCurrShell() const { return pCurrShell; }
+ void DeRegisterShell( ViewShell *pSh );
+
+ //Start-/EndAction fuer alle Shells auf moeglichst hoeher
+ //(Shell-Ableitungs-)Ebene aufsetzen. Fuer die StarONE Anbindung, die
+ //die Shells nicht dirkt kennt.
+ //Der ChangeLinkd der CrsrShell (UI-Benachrichtigung) wird im EndAllAction
+ //automatisch gecallt.
+ void StartAllAction();
+ void EndAllAction( BOOL bVirDev = FALSE );
+
+ // fuer bestimmte UNO-Aktionen (Tabellencursor) ist es notwendig, dass alle Actions
+ // kurzfristig zurueckgesetzt werden. Dazu muss sich jede ViewShell ihren alten Action-zaehler
+ // merken
+ void UnoRemoveAllActions(){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 void UnoRemoveAllActions();
+ void UnoRestoreAllActions(){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 void UnoRestoreAllActions();
+
+ const SdrPage* GetDrawPage() const { return pDrawPage; }
+ SdrPage* GetDrawPage() { return pDrawPage; }
+ void SetDrawPage( SdrPage* pNew ){ pDrawPage = pNew; }
+
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+#ifdef DBG_UTIL
+#endif
+
+#ifndef VERTICAL_LAYOUT
+ void SetFixSize( SzPtr );
+#endif
+ virtual void ChgSize( const Size& aNewSize );
+
+ inline void SetIdleFlags();
+ BOOL IsIdleFormat() const { return bIdleFormat; }
+ void ResetIdleFormat() { bIdleFormat = FALSE; }
+
+ //Sorgt dafuer, dass alle gewuenschten Seitengebunden Flys eine Seite finden
+ void SetAssertFlyPages() { bAssertFlyPages = TRUE; }
+ void AssertFlyPages();
+ BOOL IsAssertFlyPages() { return bAssertFlyPages; }
+
+ //Stellt sicher, dass ab der uebergebenen Seite auf allen Seiten die
+ //Seitengebundenen Rahmen auf der richtigen Seite (Seitennummer) stehen.
+ void AssertPageFlys( SwPageFrm * );
+
+ //Saemtlichen Inhalt invalidieren, Size oder PrtArea
+ void InvalidateAllCntnt( BYTE nInvalidate = INV_SIZE );
+
+ //Ueberfluessige Seiten entfernen.
+ void SetSuperfluous() { bCheckSuperfluous = TRUE; }
+ BOOL IsSuperfluous() const { return bCheckSuperfluous; }
+ void RemoveSuperfluous();
+
+ //abfragen/setzen der aktuellen Seite und der Gesamtzahl der Seiten.
+ //Es wird soweit wie notwendig Formatiert.
+ USHORT GetPageNum() const { return nPhyPageNums; }
+ void DecrPhyPageNums() { --nPhyPageNums; }
+ void IncrPhyPageNums() { ++nPhyPageNums; }
+ BOOL IsVirtPageNum() const { return bIsVirtPageNum; }
+ inline void SetVirtPageNum( const BOOL bOf ) const;
+
+
+ //Der Crsr moechte die zu selektierenden Bereiche wissen.
+
+ // Calculates the cells included from the current selection
+ // false: There was no result because of an invalid layout
+ // true: Everything worked fine.
+
+ void DisallowTurbo() const { ((SwRootFrm*)this)->bTurboAllowed = FALSE; }
+ void ResetTurboFlag() const { ((SwRootFrm*)this)->bTurboAllowed = TRUE; }
+ BOOL IsTurboAllowed() const { return bTurboAllowed; }
+ void SetTurbo( const SwCntntFrm *pCntnt ) { pTurbo = pCntnt; }
+ void ResetTurbo() { pTurbo = 0; }
+ const SwCntntFrm *GetTurbo() { return pTurbo; }
+
+ //Fussnotennummern aller Seiten auf den neuesten Stand bringen.
+
+ //Alle Fussnoten (nicht etwa die Referenzen) entfernen.
+ void RemoveFtns( SwPageFrm *pPage = 0, BOOL bPageOnly = FALSE,
+ BOOL bEndNotes = FALSE );
+ void CheckFtnPageDescs( BOOL bEndNote );
+
+ const SwPageFrm *GetLastPage() const { return pLastPage; }
+ SwPageFrm *GetLastPage() { return pLastPage; }
+
+ static BOOL IsInPaint() { return bInPaint; }
+
+ static void SetNoVirDev( const BOOL bNew ) { bNoVirDev = bNew; }
+
+ inline long GetBrowseWidth() const;
+ void SetBrowseWidth( long n ) { bBrowseWidthValid = TRUE; nBrowseWidth = n;}
+ inline void InvalidateBrowseWidth();
+
+
+ BOOL IsNewLayout() const { return bIsNewLayout; }
+ void ResetNewLayout() { bIsNewLayout = FALSE;}
+
+ // Hier werden leere SwSectionFrms zur Zerstoerung angemeldet
+ // und spaeter zerstoert oder wieder abgemeldet
+ void InsertEmptySct( SwSectionFrm* pDel );
+ void DeleteEmptySct() { if( pDestroy ) _DeleteEmptySct(); }
+ void RemoveFromList( SwSectionFrm* pSct ) { if( pDestroy ) _RemoveFromList( pSct ); }
+#ifdef DBG_UTIL
+ // Wird zur Zeit nur fuer ASSERTs benutzt:
+ BOOL IsInDelList( SwSectionFrm* pSct ) const; // Ist der SectionFrm in der Liste enthalten?
+#endif
+
+
+ void SetCallbackActionEnabled( BOOL b ) { bCallbackActionEnabled = b; }
+ BOOL IsCallbackActionEnabled() const { return bCallbackActionEnabled; }
+
+#ifdef ACCESSIBLE_LAYOUT
+ sal_Bool IsAnyShellAccessible() const { return nAccessibleShells > 0; }
+ void AddAccessibleShell() { ++nAccessibleShells; }
+ void RemoveAccessibleShell() { --nAccessibleShells; }
+#endif
+
+ /** get page frame by phyiscal page number
+
+ OD 14.01.2003 #103492#
+ looping through the lowers, which are page frame, in order to find the
+ page frame with the given physical page number.
+ if no page frame is found, 0 is returned.
+ Note: Empty page frames are also returned.
+
+ @param _nPageNum
+ input parameter - physical page number of page frame to be searched and
+ returned.
+
+ @return pointer to the page frame with the given physical page number
+ */
+ SwPageFrm* GetPageByPageNum( sal_uInt16 _nPageNum ) const;
+};
+
+inline long SwRootFrm::GetBrowseWidth() const
+{
+ if ( !bBrowseWidthValid )
+ ((SwRootFrm*)this)->ImplCalcBrowseWidth();
+ return nBrowseWidth;
+}
+
+inline void SwRootFrm::InvalidateBrowseWidth()
+{
+ if ( bBrowseWidthValid )
+ ImplInvalidateBrowseWidth();
+}
+
+inline void SwRootFrm::SetIdleFlags()
+{
+ bIdleFormat = TRUE;
+}
+
+inline void SwRootFrm::SetVirtPageNum( const BOOL bOf) const
+{
+ ((SwRootFrm*)this)->bIsVirtPageNum = bOf;
+}
+
+} //namespace binfilter
+#endif //_ROOTFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/rowfrm.hxx b/binfilter/bf_sw/source/core/inc/rowfrm.hxx
new file mode 100644
index 000000000000..7523c988ed0c
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/rowfrm.hxx
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _ROWFRM_HXX
+#define _ROWFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "layfrm.hxx"
+namespace binfilter {
+
+class SwTableLine;
+class SwBorderAttrs;
+
+class SwRowFrm: public SwLayoutFrm
+{
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ //Aendern nur die Framesize, nicht die PrtArea-SSize
+ virtual SwTwips ShrinkFrm( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+
+ const SwTableLine *pTabLine;
+
+protected:
+ virtual void MakeAll();
+
+public:
+ SwRowFrm( const SwTableLine & );
+ ~SwRowFrm();
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ //Zum Anmelden der Flys nachdem eine Zeile erzeugt _und_ eingefuegt wurde.
+ //Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird
+ //Das Teil gepastet; mithin ist auch erst dann die Seite zum Anmelden der
+ //Flys erreichbar.
+ void RegistFlys( SwPageFrm *pPage = 0 );
+
+ const SwTableLine *GetTabLine() const { return pTabLine; }
+
+ //Passt die Zellen auf die aktuelle Hoehe an, invalidiert die Zellen
+ //wenn die Direction nicht der Hoehe entspricht.
+ void AdjustCells( const SwTwips nHeight, const BOOL bHeight );
+ DECL_FIXEDMEMPOOL_NEWDEL(SwRowFrm)
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/scrrect.hxx b/binfilter/bf_sw/source/core/inc/scrrect.hxx
new file mode 100644
index 000000000000..5951aafb84d1
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/scrrect.hxx
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SCRRECT_HXX
+#define _SCRRECT_HXX
+
+
+#include <bf_svtools/svarray.hxx>
+#include "swrect.hxx"
+#include <swtypes.hxx>
+namespace binfilter {
+
+class SwStripe
+{
+ SwTwips nY;
+ SwTwips nHeight;
+public:
+ inline SwStripe( SwTwips nPos, SwTwips nHght )
+ : nY( nPos ), nHeight( nHght ) {}
+ inline SwTwips GetY() const { return nY; }
+ inline SwTwips& Y() { return nY; }
+ inline SwTwips GetHeight() const { return nHeight; }
+ inline SwTwips& Height() { return nHeight; }
+ inline SwTwips GetBottom() const { return nHeight ? nY + nHeight - 1 : nY; }
+ inline BOOL operator<( const SwStripe &rTst ) const
+ { return nY < rTst.nY || ( nY == rTst.nY && nHeight > rTst.nHeight ); }
+ inline BOOL operator==( const SwStripe& rTst ) const
+ { return nY == rTst.nY && nHeight == rTst.nHeight; }
+};
+
+SV_DECL_VARARR( SwStripeArr, SwStripe, 1, 4 )//STRIP008 ;
+
+class SwStripes : public SwStripeArr, public SwStripe
+{
+ SwTwips nMin; // Left minimum
+ SwTwips nMax; // Right maximum
+public:
+#ifdef VERTICAL_LAYOUT
+ SwStripes( SwTwips nPos, SwTwips nSize, SwTwips nMn, SwTwips nMx )
+ : SwStripe( nPos, nSize ), nMin( nMn ), nMax( nMx ) {}
+#else
+ SwStripes( const SwRect& rRect ) : SwStripe( rRect.Top(), rRect.Height() ),
+ nMin(rRect.Left()), nMax(rRect.Left() + rRect.Width()) {}
+#endif
+ inline SwTwips GetMin() const { return nMin; }
+ inline SwTwips GetMax() const { return nMax; }
+ inline void SetMin( const SwTwips nNew ) { nMin = nNew; }
+ inline void SetMax( const SwTwips nNew ) { nMax = nNew; }
+ inline void ChkMin( const SwTwips nNew ) { if( nNew < nMin ) nMin = nNew; }
+ inline void ChkMax( const SwTwips nNew ) { if( nNew > nMax ) nMax = nNew; }
+ inline SwTwips GetRight() const { return nMax > nMin ? nMax - 1 : nMax; }
+ inline SwTwips GetWidth() const { return nMax - nMin; }
+};
+
+class SwScrollColumn
+{
+ SwTwips nX;
+ SwTwips nWidth;
+ SwTwips nOffs;
+#ifdef VERTICAL_LAYOUT
+ BOOL bVertical;
+public:
+ inline SwScrollColumn( SwTwips nPos, SwTwips nSz, SwTwips nOff, BOOL bVert )
+ : nX( nPos ), nWidth( nSz ), nOffs( nOff ), bVertical( bVert ) {}
+ inline SwScrollColumn( const SwScrollColumn& rCol )
+ : nX( rCol.nX ), nWidth( rCol.nWidth ),
+ nOffs( rCol.nOffs ), bVertical( rCol.bVertical ) {}
+ BOOL IsVertical() const { return bVertical; }
+ inline BOOL operator<( const SwScrollColumn &rTst ) const
+ { return bVertical < rTst.bVertical || ( bVertical == rTst.bVertical &&
+ ( nX < rTst.nX || ( nX == rTst.nX && ( nWidth < rTst.nWidth ||
+ ( nWidth == rTst.nWidth && nOffs < rTst.nOffs ) ) ) ) ); }
+ inline BOOL operator==( const SwScrollColumn &rTst ) const
+ { return bVertical == rTst.bVertical && nX == rTst.nX &&
+ nWidth == rTst.nWidth && nOffs == rTst.nOffs;}
+#else
+public:
+ inline SwScrollColumn( const SwRect& rRect, SwTwips nOff )
+ : nX( rRect.Left() ), nWidth( rRect.Width() ), nOffs( nOff ) {}
+ inline SwScrollColumn( const SwScrollColumn& rCol )
+ : nX( rCol.nX ), nWidth( rCol.nWidth ), nOffs( rCol.nOffs ) {}
+ inline BOOL operator<( const SwScrollColumn &rTst ) const
+ { return nX < rTst.nX || ( nX == rTst.nX && ( nWidth < rTst.nWidth ||
+ ( nWidth == rTst.nWidth && nOffs < rTst.nOffs ) ) ); }
+ inline BOOL operator==( const SwScrollColumn &rTst ) const
+ { return nX == rTst.nX && nWidth == rTst.nWidth && nOffs == rTst.nOffs;}
+#endif
+ inline SwTwips GetX() const { return nX; }
+ inline SwTwips GetWidth() const { return nWidth; }
+ inline SwTwips GetOffs() const { return nOffs; }
+ inline void ClrOffs() { nOffs = 0; }
+ inline SwTwips GetRight() const { return nWidth ? nX + nWidth - 1 : nX; }
+};
+
+typedef SwStripes* SwStripesPtr;
+SV_DECL_PTRARR_SORT(SwScrollStripes, SwStripesPtr, 1, 4)
+
+class SwScrollArea : public SwScrollColumn, public SwScrollStripes
+{
+public:
+ inline SwScrollArea( const SwScrollColumn &rCol, SwStripes* pStripes )
+ : SwScrollColumn( rCol )
+ { Insert( pStripes ); }
+};
+
+typedef SwScrollArea* SwScrollAreaPtr;
+SV_DECL_PTRARR_SORT(SScrAreas,SwScrollAreaPtr,1,2)//STRIP008 ;
+
+class SwScrollAreas : public SScrAreas
+{
+public:
+};
+
+
+} //namespace binfilter
+#endif //_SCRRECT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/sectfrm.hxx b/binfilter/bf_sw/source/core/inc/sectfrm.hxx
new file mode 100644
index 000000000000..1bdabf05c508
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/sectfrm.hxx
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SECTFRM_HXX
+#define _SECTFRM_HXX
+
+#include <tools/mempool.hxx>
+
+#include "layfrm.hxx"
+#include "flowfrm.hxx"
+namespace binfilter {
+
+class SwSection;
+class SwSectionFmt;
+class SwAttrSetChg;
+class SwFtnContFrm;
+class SwFtnFrm;
+class SwLayouter;
+
+#define FINDMODE_ENDNOTE 1
+#define FINDMODE_LASTCNT 2
+#define FINDMODE_MYLAST 4
+
+class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm
+{
+ SwSection* pSection;
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+ void _Cut( BOOL bRemove );
+ // Is there a FtnContainer?
+ // An empty sectionfrm without FtnCont is superfluous
+ BOOL IsSuperfluous() const { return !ContainsAny() && !ContainsFtnCont(); }
+ void CalcFtnAtEndFlag();
+ void CalcEndAtEndFlag();
+protected:
+ virtual void MakeAll();
+ virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat ){DBG_BF_ASSERT(0, "STRIP"); return FALSE;} //STRIP001 virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+public:
+ SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt!
+ SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows
+ ~SwSectionFrm();
+
+ void Init();
+ virtual void CheckDirection( BOOL bVert );
+
+ virtual void Cut();
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ inline const SwSectionFrm *GetFollow() const;
+ inline SwSectionFrm *GetFollow();
+ inline const SwSectionFrm *FindMaster() const;
+ inline SwSectionFrm *FindMaster();
+ SwCntntFrm *FindLastCntnt( BYTE nMode = 0 );
+ inline const SwCntntFrm *FindLastCntnt( BYTE nMode = 0 ) const;
+ inline SwSection* GetSection() { return pSection; }
+ inline const SwSection* GetSection() const { return pSection; }
+ inline void ColLock() { bColLocked = TRUE; }
+ inline void ColUnlock() { bColLocked = FALSE; }
+
+ void CalcFtnCntnt();
+ void SimpleFormat();
+ void MergeNext( SwSectionFrm* pNxt );
+ //Zerlegt den pFrm umgebenden SectionFrm in zwei Teile,
+ //pFrm an den Anfang des 2. Teils
+ void DelEmpty( BOOL bRemove ); // wie Cut(), Follow-Verkettung wird aber mitgepflegt
+ BOOL IsToIgnore() const // Keine Groesse, kein Inhalt, muss ignoriert werden
+ { return !Frm().Height() && !ContainsCntnt(); }
+ SwSectionFrm *FindSectionMaster();
+ SwFtnContFrm* ContainsFtnCont( const SwFtnContFrm* pCont = NULL ) const;
+ BOOL Growable() const;
+ SwTwips _Shrink( SwTwips, SZPTR BOOL bTst );
+ SwTwips _Grow ( SwTwips, SZPTR BOOL bTst );
+
+ // A sectionfrm has to maximize, if he has a follow or a ftncontainer at
+ // the end of the page. A superfluous follow will be ignored,
+ // if bCheckFollow is set.
+ BOOL ToMaximize( BOOL bCheckFollow ) const;
+ inline BOOL _ToMaximize() const
+ { if( !pSection ) return FALSE; return ToMaximize( FALSE ); }
+ BOOL MoveAllowed( const SwFrm* ) const;
+ BOOL CalcMinDiff( SwTwips& rMinDiff ) const;
+ // Uebergibt man kein bOverSize bzw. FALSE, so ist der Returnwert
+ // >0 fuer Undersized-Frames, ==0 sonst.
+ // Uebergibt man TRUE, so kann es auch einen negativen Returnwert geben,
+ // wenn der SectionFrm nicht vollstaendig ausgefuellt ist, was z.B. bei
+ // SectionFrm mit Follow meist vorkommt. Benoetigt wird dies im
+ // FormatWidthCols, um "Luft" aus den Spalten zu lassen.
+ long Undersize( BOOL bOverSize = FALSE );
+ // Groesse an die Umgebung anpassen
+ void _CheckClipping( BOOL bGrow, BOOL bMaximize );
+
+ void InvalidateFtnPos();
+
+ static void MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave );
+ DECL_FIXEDMEMPOOL_NEWDEL(SwSectionFrm)
+};
+
+typedef SwSectionFrm* SwSectionFrmPtr;
+SV_DECL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr, 1, 5)
+
+inline const SwSectionFrm *SwSectionFrm::GetFollow() const
+{
+ return (const SwSectionFrm*)SwFlowFrm::GetFollow();
+}
+inline SwSectionFrm *SwSectionFrm::GetFollow()
+{
+ return (SwSectionFrm*)SwFlowFrm::GetFollow();
+}
+
+inline const SwSectionFrm *SwSectionFrm::FindMaster() const
+{
+ return (const SwSectionFrm*)SwFlowFrm::FindMaster();
+}
+inline SwSectionFrm *SwSectionFrm::FindMaster()
+{
+ return (SwSectionFrm*)SwFlowFrm::FindMaster();
+}
+
+inline const SwCntntFrm *SwSectionFrm::FindLastCntnt( BYTE nMode ) const
+{
+ return ((SwSectionFrm*)this)->FindLastCntnt( nMode );
+}
+
+
+} //namespace binfilter
+#endif //_SECTFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/setmapvirtdev.hxx b/binfilter/bf_sw/source/core/inc/setmapvirtdev.hxx
new file mode 100644
index 000000000000..4965afa41abe
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/setmapvirtdev.hxx
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SETMAPVIRTDEV_HXX
+#define _SETMAPVIRTDEV_HXX
+class OutputDevice;
+class VirtualDevice;
+class MapMode;
+class Point;
+namespace binfilter {
+
+
+
+/** method to set mapping/pixel offset for virtual output device
+
+ OD 12.11.2002 #96272# - method implements two solutions for the mapping of
+ the virtual output device:
+ The old solution set the origin of the mapping mode, which will be used in
+ the virtual output device. This causes several paint errors, because of the
+ different roundings in the virtual output device and the original output device.
+ The new solution avoids the rounding differences between virtual and original
+ output device by setting a pixel offset at the virtual output device.
+ A local boolean controls, which solution is used, in order to switch in
+ escalation back to old solution.
+
+ @author OD
+
+ @param _pOrgOutDev
+ input parameter - constant instance of the original output device, for which
+ the virtual output device is created.
+
+ @param _pVirDev
+ input/output parameter - instance of the virtual output device.
+
+ @param _pMapMode
+ input/output parameter - instance of the mapping mode, which will be set
+ at the virtual output device.
+
+ @param _rNewOrigin
+ input parameter - constant instance of the origin, which will be used in
+ the virtual output device
+*/
+void SetMappingForVirtDev( const Point& _rNewOrigin,
+ MapMode* _pMapMode,
+ const OutputDevice* _pOrgOutDev,
+ VirtualDevice* _pVirDev );
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/splargs.hxx b/binfilter/bf_sw/source/core/inc/splargs.hxx
new file mode 100644
index 000000000000..29ab650fd06b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/splargs.hxx
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SPLARGS_HXX
+#define _SPLARGS_HXX
+
+#include <tools/solar.h>
+#include <tools/gen.hxx>
+#include <limits.h> // USHRT_MAX
+#include <tools/string.hxx>
+
+class SwTxtNode;
+class SwIndex;
+class SpellCheck;
+
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+namespace binfilter {
+
+/*************************************************************************
+ * struct SwConversionArgs
+ *************************************************************************/
+
+
+struct SwArgsBase // used for text conversion (Hangul/Hanja, ...)
+{
+ SwTxtNode *pStartNode;
+ SwIndex &rStartIdx;
+ SwTxtNode *pEndNode;
+ SwIndex &rEndIdx;
+
+ SwArgsBase(
+ SwTxtNode* pStart, SwIndex& rStart,
+ SwTxtNode* pEnd, SwIndex& rEnd )
+ : pStartNode( pStart ), rStartIdx( rStart ),
+ pEndNode( pEnd ), rEndIdx( rEnd )
+ {}
+};
+
+/*************************************************************************
+ * struct SwConversionArgs
+ * used for text conversion (Hangul/Hanja, ...)
+ *************************************************************************/
+
+struct SwConversionArgs : SwArgsBase
+{
+ ::rtl::OUString aConvText;
+ sal_Bool bConvTextFound; // convertible text portion found
+
+ SwConversionArgs(
+ SwTxtNode* pStart, SwIndex& rStart,
+ SwTxtNode* pEnd, SwIndex& rEnd )
+ : SwArgsBase( pStart, rStart, pEnd, rEnd ),
+ bConvTextFound( sal_False )
+ {}
+};
+
+/*************************************************************************
+ * struct SwSpellArgs
+ *************************************************************************/
+
+struct SwSpellArgs : SwArgsBase
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellAlternatives > xSpellAlt;
+
+ SwSpellArgs(::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XSpellChecker1 > &rxSplChk,
+ SwTxtNode* pStart, SwIndex& rStart,
+ SwTxtNode* pEnd, SwIndex& rEnd )
+ : SwArgsBase( pStart, rStart, pEnd, rEnd ),
+ xSpeller( rxSplChk )
+ {}
+};
+
+/*************************************************************************
+ * class SwInterHyphInfo
+ *************************************************************************/
+
+// Parameter-Klasse fuer Hyphenate
+// docedt.cxx: SwDoc::Hyphenate()
+// txtedt.cxx: SwTxtNode::Hyphenate()
+// txthyph.cxx: SwTxtFrm::Hyphenate()
+
+class SwInterHyphInfo
+{
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
+ const Point aCrsrPos;
+ sal_Bool bAuto : 1;
+ sal_Bool bNoLang : 1;
+ sal_Bool bCheck : 1;
+public:
+ xub_StrLen nStart;
+ xub_StrLen nLen;
+ xub_StrLen nWordStart;
+ xub_StrLen nWordLen;
+ xub_StrLen nHyphPos;
+ sal_uInt16 nMinTrail;
+
+ inline SwInterHyphInfo( const Point &rCrsrPos,
+ const sal_uInt16 nStart = 0,
+ const sal_uInt16 nLen = USHRT_MAX )
+ : aCrsrPos( rCrsrPos ),
+ bAuto(sal_False), bNoLang(sal_False), bCheck(sal_False),
+ nStart(nStart), nLen(nLen),
+ nWordStart(0), nWordLen(0),
+ nMinTrail(0), nHyphPos(0)
+ { }
+ inline xub_StrLen GetStart() const { return nStart; }
+ inline xub_StrLen GetLen() const { return nLen; }
+ inline xub_StrLen GetEnd() const
+ { return STRING_LEN == nLen ? nLen : nStart + nLen; }
+ inline const Point *GetCrsrPos() const
+ { return aCrsrPos.X() || aCrsrPos.Y() ? &aCrsrPos : 0; }
+ inline sal_Bool IsAuto() const { return bAuto; }
+ inline void SetAuto( const sal_Bool bNew ) { bAuto = bNew; }
+ inline sal_Bool IsCheck() const { return bCheck; }
+ inline void SetCheck( const sal_Bool bNew ) { bCheck = bNew; }
+ inline sal_Bool IsNoLang() const { return bNoLang; }
+ inline void SetNoLang( const sal_Bool bNew ) { bNoLang = bNew; }
+
+ inline void
+ SetHyphWord(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord > &rxHW)
+ { xHyphWord = rxHW; }
+ inline ::com::sun::star::uno::Reference<
+ ::com::sun::star::linguistic2::XHyphenatedWord >
+ GetHyphWord() { return xHyphWord; }
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/splcstk.hxx b/binfilter/bf_sw/source/core/inc/splcstk.hxx
new file mode 100644
index 000000000000..e035feb2b6a4
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/splcstk.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SPLCSTK_HXX
+#define _SPLCSTK_HXX
+
+#include <tools/solar.h>
+namespace binfilter {
+
+class SwIntrnlCrsr;
+class SwCrsrShell;
+struct SwPosition;
+
+class SwSpellCrsrStk
+{
+ SwPosition* pErrorPos;
+ SwIntrnlCrsr * pCurCrsr; // der aktuelle Cursor
+ SwIntrnlCrsr * pCrsrStk; // der Cursor-Stack
+ SwCrsrShell & rCrsrShell; // die akt. CrsrShell
+
+public:
+ SwSpellCrsrStk( SwCrsrShell& rShell );
+ ~SwSpellCrsrStk();
+
+ void SetCurCrsr(); // akt. Cursor in der CrsrShell mit akt. setzen
+ BOOL SetNextCrsr(); // gehe zum naechsten Cursor im Ring (falls am
+ // Ende returne FALSE;
+ void RestoreCrsrs(); // alle Cursor aus dem CursorStack wieder
+ // in der Shell setzen
+ void StoreErrPos(); // speicher die akt. Start-Position als Error,
+ // an dieser wird spaeter wieder aufgesetzt
+ void SetErrPos(); // akt. Cursor auf die Error Position setzen
+
+#if 0
+ // ??? wird das ueberhaupt benoetigt ???
+ // fuer die EditShell, damit sie die Cursor
+ // aus den Loeschbereichen verschieben kann
+ SwPaM* GetCurCrsr() const;
+ SwPosition* GetErrorPos() const { return pErrorPos; }
+#endif
+};
+
+
+} //namespace binfilter
+#endif // _SPLCSTK_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/swblocks.hxx b/binfilter/bf_sw/source/core/inc/swblocks.hxx
new file mode 100644
index 000000000000..7a2bb3ba1bb9
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/swblocks.hxx
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWBLOCKS_HXX
+#define _SWBLOCKS_HXX
+
+#include <bf_so3/persist.hxx>
+/*N*/#include <tools/debug.hxx> //addded for stripping
+class SvxMacroTableDtor;
+namespace binfilter {
+
+class SfxMedium;
+class SwPaM;
+class SwDoc;
+
+class SvXMLTextBlocks;
+// Name eines Textblocks:
+
+
+
+
+class SwImpBlocks
+{
+ friend class SwTextBlocks;
+protected:
+ String aFile; // physikalischer Dateiname
+ String aName; // logischer Name der Datei
+ SwImpBlocks( const String&, BOOL = FALSE ){DBG_ASSERT(0, "STRIP")}; //STRIP001 ;
+public:
+ const String& GetFileName() const {return aFile;} // phys. Dateinamen liefern
+};
+
+
+
+
+class Sw3Io;
+class Sw3IoImp;
+
+class Sw3TextBlocks : public SwImpBlocks
+{
+
+public:
+ Sw3TextBlocks( const String& rFile): SwImpBlocks( rFile ){DBG_BF_ASSERT(0, "STRIP");} ;//STRIP001 Sw3TextBlocks( const String& );
+
+
+
+ // Methoden fuer die neue Autokorrektur
+
+
+
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/swcache.hxx b/binfilter/bf_sw/source/core/inc/swcache.hxx
new file mode 100644
index 000000000000..29e85864e8df
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/swcache.hxx
@@ -0,0 +1,304 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWCACHE_HXX
+#define _SWCACHE_HXX
+
+
+
+
+/*
+ * Es werden Pointer auf Objekte verwaltet. Diese werden in einem einfachen
+ * PtrArray verwaltet.
+ * Angelegt (new) werden die Objekte von Cache-Zugriffsklassen, zuerstoert
+ * werden die Objekte vom Cache.
+ *
+ * Auf die Objekte kann wahlweise per Index in das Array oder per Suche
+ * zugegriffen werden. Soll per Index zugegriffen werden, so obliegt die
+ * Verwaltung des Index dem Anwender des Cache.
+ *
+ * Fuer die verwalteten Cache-Objekte gibt es eine Basisklasse, von dieser
+ * sind spezifische Klassen abzuleiten.
+ * In der Basisklasse werden die Cache-Objekte eines Cache doppelt verkettet,
+ * das ermoeglich die Implementierung eines LRU-Algorithmus.
+ *
+ * Der LRU kann in der Cache-Basisklasse manipuliert werden, indem ein
+ * virtueller First-Pointer gesetzt wird. Dieser kann auf den echten ersten
+ * plus einem Ofst gesetzt werden. Dadurch kann man den Anfangsbereich des
+ * Cache sichern und so dafuer sorgen, dass man waehrend bestimmter
+ * Operationen nicht den Cache versaut. Beispiel: Der Idle-Handler sollte nicht
+ * den Cache fuer den sichtbaren Bereich vernichten.
+ *
+ * Der Cache kann in der Groesse erweitert und wieder verkleinert werden.
+ * Beispiel: Fuer jede neue Shell wird der Cache fuer FormatInfo vergrossert
+ * und beim Destruieren der Shell wieder verkleinert.
+ *
+ */
+
+#ifdef DBG_UTIL
+#include <tools/string.hxx>
+#endif
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#include <bf_svtools/svstdarr.hxx>
+#endif
+namespace binfilter {
+class SwCacheObj;
+
+SV_DECL_PTRARR_DEL(SwCacheObjArr,SwCacheObj*,1,1)
+
+class SwCache : public SwCacheObjArr
+{
+ SvUShorts aFreePositions; //Freie Positionen fuer das Insert wenn
+ //die Maximalgrenze nicht erreicht ist.
+ //Immer wenn ein Objekt ausgetragen wird,
+ //so wird seine Position hier eingetragen.
+
+ SwCacheObj *pRealFirst; //_immer_ der echte LRU-erste
+ SwCacheObj *pFirst; //der virtuelle erste.
+ SwCacheObj *pLast;
+
+ const USHORT nMax; //Mehr sollen nicht aufgenommen werden,
+ //der Cache kann aber dynamisch um jeweils
+ //nMax vergroessert werden.
+ USHORT nCurMax; //Mehr werden nicht aufgenommen.
+
+
+ void DeleteObj( SwCacheObj *pObj );
+
+#ifdef DBG_UTIL
+ ByteString aName;
+ long nAppend; //Anzahl der Eintragungen durch Erweiterung.
+ long nInsertFree; //Anzahl der Eintragungen auf freie Plaetze.
+ long nReplace; //Anzahl der Ersetzungen durch ein neues Objekt
+ long nGetSuccess; //Anzahl der Erfolgreichen Get's
+ long nGetFail; //Anzahl der nicht Erfolgreichen Get's
+ long nToTop; //Anzahl der Umsortierungen (LRU)
+ long nDelete; //Anzahl der Loeschungen (von Aussen)
+ long nGetSeek; //Anzahl der Get's ohne Index
+ long nAverageSeekCnt; //Anzahl der Seek's fuer alle Get's ohne Index
+ long nFlushCnt; //Anzahl von Flush-Aufrufen.
+ long nFlushedObjects; //Anzahl der wg. Flush vernichteten Objekte
+ long nIncreaseMax; //Anzahl Cache-Erweiterungen
+ long nDecreaseMax; //Anzahl Cache-Verkleinerungen
+
+ void Check(); //Wird bei swcache.cxx mit DEBUG aktiv!
+#endif
+
+public:
+
+ //nur BYTE hineinstecken!!!
+#ifdef DBG_UTIL
+ SwCache( const USHORT nInitSize, const USHORT nGrowSize,
+ const ByteString &rNm );
+ ~SwCache();
+#else
+ SwCache( const USHORT nInitSize, const USHORT nGrowSize );
+#endif
+
+ void Flush( const BYTE nPercent = 100 );
+
+ //bToTop == FALSE -> Keine LRU-Umsortierung!
+ SwCacheObj *Get( const void *pOwner, const BOOL bToTop = TRUE );
+ SwCacheObj *Get( const void *pOwner, const USHORT nIndex,
+ const BOOL bToTop = TRUE );
+ void ToTop( SwCacheObj *pObj );
+
+ BOOL Insert( SwCacheObj *pNew );
+ void Delete( const void *pOwner );
+// void Delete( const void *pOwner, const USHORT nIndex );
+
+ void SetLRUOfst( const USHORT nOfst ); //nOfst sagt wieviele unangetastet
+ //bleiben sollen.
+ void ResetLRUOfst() { pFirst = pRealFirst; }
+
+ inline void IncreaseMax( const USHORT nAdd );
+ inline void DecreaseMax( const USHORT nSub );
+ USHORT GetCurMax() const { return nCurMax; }
+ inline SwCacheObj *First() { return pRealFirst; }
+ inline SwCacheObj *Last() { return pLast; }
+ inline SwCacheObj *Next( SwCacheObj *pCacheObj);
+};
+
+//Cache-Manipulation auf die sichere Art.
+class SwSaveSetLRUOfst
+{
+ SwCache &rCache;
+public:
+ SwSaveSetLRUOfst( SwCache &rC, const USHORT nOfst )
+ : rCache( rC ) { rCache.SetLRUOfst( nOfst ); }
+
+ ~SwSaveSetLRUOfst() { rCache.ResetLRUOfst(); }
+};
+
+//Das allgemeine CacheObjekt. Anwender des Cache muessen eine Klasse vom
+//CacheObjekt ableiten und dort die Nutzdaten unterbringen.
+
+class SwCacheObj
+{
+ friend class SwCache; //Der darf alles
+
+ SwCacheObj *pNext; //Fuer die LRU-Verkettung.
+ SwCacheObj *pPrev;
+
+ USHORT nCachePos; //Position im Cache-Array.
+
+ BYTE nLock;
+
+ inline SwCacheObj *GetNext() { return pNext; }
+ inline SwCacheObj *GetPrev() { return pPrev; }
+ inline void SetNext( SwCacheObj *pNew ) { pNext = pNew; }
+ inline void SetPrev( SwCacheObj *pNew ) { pPrev = pNew; }
+
+ inline void SetCachePos( const USHORT nNew ) { nCachePos = nNew; }
+
+protected:
+ const void *pOwner;
+ inline void SetOwner( const void *pNew ) { pOwner = pNew; }
+
+public:
+
+ SwCacheObj( const void *pOwner );
+ virtual ~SwCacheObj();
+
+ inline const void *GetOwner() const { return pOwner; }
+ inline BOOL IsOwner( const void *pNew ) const;
+
+ inline USHORT GetCachePos() const { return nCachePos; }
+ inline void Invalidate() { pOwner = 0; }
+
+ inline BOOL IsLocked() const { return 0 != nLock; }
+
+#ifndef DBG_UTIL
+ inline void Lock() { ++nLock; }
+ inline void Unlock() { --nLock; }
+#else
+ void Lock();
+ void Unlock();
+#endif
+
+ SwCacheObj *Next() { return pNext; }
+ SwCacheObj *Prev() { return pPrev; }
+
+};
+
+//Zugriffsklasse fuer den Cache. Im CTor wird das CacheObjekt erzeugt.
+//Wenn der Cache keines herausrueckt wird der Member zunaechst auf 0 gesetzt.
+//Beim Get wird dann eines erzeugt und, falls moeglich, in den Cache
+//eingetragen.
+//Anwender der des Cache muessen eine Klasse vom Access ableiten um
+//fuer Typsicherheit zu sorgen, die Basisklasse sollte fuer das Get aber immer
+//gerufen werden, ein Abgeleitetes Get sollte nur der Typsicherheit dienen.
+//Cache-Objekte werden stets gelockt solange die Instanz lebt.
+
+class SwCacheAccess
+{
+ SwCache &rCache;
+
+ void _Get();
+
+protected:
+ SwCacheObj *pObj;
+ const void *pOwner; //Kann ggf. in NewObj benutzt werden.
+
+ virtual SwCacheObj *NewObj() = 0;
+
+ inline SwCacheObj *Get();
+
+ inline SwCacheAccess( SwCache &rCache, const void *pOwner, BOOL bSeek = TRUE );
+ inline SwCacheAccess( SwCache &rCache, const void *pOwner, const USHORT nIndex );
+
+public:
+ ~SwCacheAccess() { if ( pObj ) pObj->Unlock(); }
+
+
+ //Abkuerzung fuer diejenigen, die wissen, das die Ableitung das IsAvailable
+ //nicht ueberladen haben.
+ BOOL IsAvail() const { return pObj != 0; }
+};
+
+inline void SwCache::IncreaseMax( const USHORT nAdd )
+{
+ nCurMax += nAdd;
+#ifdef DBG_UTIL
+ ++nIncreaseMax;
+#endif
+}
+inline void SwCache::DecreaseMax( const USHORT nSub )
+{
+ if ( nCurMax > nSub )
+ nCurMax -= nSub;
+#ifdef DBG_UTIL
+ ++nDecreaseMax;
+#endif
+}
+
+inline BOOL SwCacheObj::IsOwner( const void *pNew ) const
+{
+ return pOwner && pOwner == pNew;
+}
+
+inline SwCacheObj *SwCache::Next( SwCacheObj *pCacheObj)
+{
+ if ( pCacheObj )
+ return pCacheObj->GetNext();
+ else
+ return NULL;
+}
+
+inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, BOOL bSeek ) :
+ rCache( rC ),
+ pOwner( pOwn ),
+ pObj( 0 )
+{
+ if ( bSeek && pOwner && 0 != (pObj = rCache.Get( pOwner )) )
+ pObj->Lock();
+}
+
+inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn,
+ const USHORT nIndex ) :
+ rCache( rC ),
+ pOwner( pOwn ),
+ pObj( 0 )
+{
+ if ( pOwner && 0 != (pObj = rCache.Get( pOwner, nIndex )) )
+ pObj->Lock();
+}
+
+inline SwCacheObj *SwCacheAccess::Get()
+{
+ if ( !pObj )
+ _Get();
+ return pObj;
+}
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/swfntcch.hxx b/binfilter/bf_sw/source/core/inc/swfntcch.hxx
new file mode 100644
index 000000000000..388c53c5f929
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/swfntcch.hxx
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWFNTCCH_HXX
+#define _SWFNTCCH_HXX
+
+#include <tools/mempool.hxx>
+
+#define NUM_DEFAULT_VALUES 34
+
+#include "swcache.hxx"
+#include "swfont.hxx"
+namespace binfilter {
+
+class SfxPoolItem;
+class ViewShell;
+
+
+/*************************************************************************
+ * class SwFontCache
+ *************************************************************************/
+
+class SwFontCache : public SwCache
+{
+public:
+
+ inline SwFontCache() : SwCache(50,50
+#ifdef DBG_UTIL
+ , "Globaler AttributSet/Font-Cache pSwFontCache"
+#endif
+ ) {}
+
+};
+
+// AttributSet/Font-Cache, globale Variable, in FontCache.Cxx angelegt
+extern SwFontCache *pSwFontCache;
+
+/*************************************************************************
+ * class SwFontObj
+ *************************************************************************/
+
+class SwFontObj : public SwCacheObj
+{
+ friend class SwFontAccess;
+
+private:
+ SwFont aSwFont;
+ const SfxPoolItem* pDefaultArray[ NUM_DEFAULT_VALUES ];
+
+public:
+ DECL_FIXEDMEMPOOL_NEWDEL(SwFontObj)
+
+ SwFontObj( const void* pOwner, ViewShell *pSh );
+
+ virtual ~SwFontObj();
+
+ inline SwFont *GetFont() { return &aSwFont; }
+ inline const SwFont *GetFont() const { return &aSwFont; }
+ inline const SfxPoolItem** GetDefault() { return pDefaultArray; }
+};
+
+/*************************************************************************
+ * class SwFontAccess
+ *************************************************************************/
+
+
+class SwFontAccess : public SwCacheAccess
+{
+ ViewShell *pShell;
+protected:
+ virtual SwCacheObj *NewObj( );
+
+public:
+ SwFontAccess( const void *pOwner, ViewShell *pSh );
+ SwFontObj *Get();
+};
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/swfont.hxx b/binfilter/bf_sw/source/core/inc/swfont.hxx
new file mode 100644
index 000000000000..5fde26786ba4
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/swfont.hxx
@@ -0,0 +1,859 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWFONT_HXX
+#define _SWFONT_HXX
+
+
+#include <i18npool/lang.h>
+#include <tools/color.hxx>
+#include <tools/stream.hxx>
+#include <bf_svx/svxfont.hxx>
+#include <swtypes.hxx>
+#include <drawfont.hxx> // SwDrawTextInfo
+namespace binfilter {
+
+class SfxItemSet;
+class LinguBase; // SetLingu()
+
+class SwAttrSet;
+class SwDoCapitals; // DoCapitals
+class SwWrongList;
+class SwDrawTextInfo; // _DrawText
+class SwScriptInfo; // _GetTxtSize
+class ViewShell;
+class SwDoc;
+
+const xub_Unicode CH_BLANK = ' '; // ' ' Leerzeichen
+const xub_Unicode CH_BREAK = 0x0A; //
+const xub_Unicode CH_TAB = '\t'; // \t
+const xub_Unicode CH_PAR = 0xB6; // Paragraph
+const xub_Unicode CH_BULLET = 0xB7; // mittiger Punkt
+
+class SwSubFont : public SvxFont
+{
+ friend class SwFont;
+ const void *pMagic; // "MagicNumber" innerhalb des Fontcaches
+ Size aSize; // Fremde kriegen nur diese Size zu sehen
+ USHORT nFntIndex; // Index im Fontcache
+ USHORT nOrgHeight; // Hoehe inkl. Escapement/Proportion
+ USHORT nOrgAscent; // Ascent inkl. Escapement/Proportion
+ USHORT nPropWidth; // proportional width
+ inline SwSubFont() : aSize(0,0)
+ { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; }
+
+ USHORT CalcEscAscent( const USHORT nOldAscent ) const;
+ USHORT CalcEscHeight( const USHORT nOldHeight,
+ const USHORT nOldAscent ) const;
+
+ inline void CopyMagic( const SwSubFont& rFnt )
+ { pMagic = rFnt.pMagic; nFntIndex = rFnt.nFntIndex; }
+
+ BOOL operator==( const SwFont &rFnt ) const;
+ SwSubFont& operator=( const SwSubFont &rFont );
+
+ short _CheckKerning( );
+
+ BOOL ChgFnt( ViewShell *pSh, OutputDevice *pOut );
+ BOOL IsSymbol( ViewShell *pSh );
+ USHORT GetAscent( ViewShell *pSh, const OutputDevice *pOut );
+ USHORT GetHeight( ViewShell *pSh, const OutputDevice *pOut );
+ Size _GetTxtSize( SwDrawTextInfo& rInf );
+ Size GetCapitalSize( SwDrawTextInfo& rInf );
+ void DoOnCapitals( SwDoCapitals &rDo );
+ xub_StrLen _GetCrsrOfst( SwDrawTextInfo& rInf );
+
+ inline void SetColor( const Color& rColor );
+ inline void SetFillColor( const Color& rColor );
+ inline void SetCharSet( const CharSet eCharSet );
+ inline void SetPitch( const FontPitch ePitch );
+ inline void SetAlign( const FontAlign eAlign );
+ inline void SetUnderline( const FontUnderline eUnderline );
+ inline void SetStrikeout( const FontStrikeout eStrikeout );
+ inline void SetItalic( const FontItalic eItalic );
+ inline void SetOutline( const BOOL bOutline );
+ inline void SetVertical( const USHORT nDir, const BOOL bVertFormat );
+ inline void SetShadow( const BOOL bShadow );
+ inline void SetAutoKern( const BYTE nAutoKern );
+ inline void SetWordLineMode( const BOOL bWordLineMode );
+ inline void SetEmphasisMark( const FontEmphasisMark eValue );
+ inline void SetRelief( const FontRelief eNew );
+
+ // Methoden fuer die Hoch-/Tiefstellung
+ inline void SetEscapement( const short nNewEsc );
+ inline void SetProportion( const BYTE nNewPropr );
+
+ inline void SetFamily( const FontFamily eFamily );
+ inline void SetName( const XubString& rName );
+ inline void SetStyleName( const XubString& rStyleName );
+ inline void SetSize( const Size& rSize );
+ inline void SetWeight( const FontWeight eWeight );
+ inline void SetLanguage( LanguageType eNewLang );
+ inline short CheckKerning()
+ { return GetFixKerning() >= 0 ? GetFixKerning() : _CheckKerning( ); }
+ inline void SetPropWidth( const USHORT nNew )
+ { pMagic = 0; nPropWidth = nNew; }
+public:
+ USHORT GetPropWidth() const { return nPropWidth; }
+};
+
+#define SW_LATIN 0
+#define SW_CJK 1
+#define SW_CTL 2
+#define SW_SCRIPTS 3
+
+class SwFont
+{ // CJK == Chinese, Japanese, Korean
+ // CTL == Complex text layout ( Hebrew, Arabic )
+ SwSubFont aSub[SW_SCRIPTS]; // Latin-, CJK- and CTL-font
+ Color* pBackColor; // background color (i.e. at character styles)
+ Color aUnderColor; // color of the underlining
+ BYTE nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
+ BYTE nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
+ BYTE nActual; // actual font (Latin, CJK or CTL)
+
+ // Schalter fuer die Font-Extensions
+ BOOL bNoHyph :1; // SwTxtNoHyphenHere: keine Trennstelle
+ BOOL bBlink :1; // blinkender Font
+ BOOL bPaintBlank :1; // Blanks nicht mit DrawRect
+ BOOL bFntChg :1;
+ BOOL bOrgChg :1; // nOrgHeight/Ascent sind invalid
+ BOOL bURL :1;
+ BOOL bPaintWrong :1; // Flag fuer Rechtschreibfehler
+ BOOL bGreyWave :1; // Fuers extended TextInput: Graue Wellenlinie
+ BOOL bNoColReplace :1; // Replacement without colormanipulation
+
+ BOOL operator==( const SwFont &rFnt ) const;
+
+protected:
+ inline SwFont() { pBackColor = NULL; nActual = SW_LATIN; }
+
+public:
+ SwFont( const SwAttrSet* pSet, const SwDoc *pDoc );
+ SwFont( const SwFont& rFont );
+
+ inline void ChgFnt( ViewShell *pSh, OutputDevice *pOut )
+ { bPaintBlank = aSub[nActual].ChgFnt( pSh, pOut ); }
+
+ ~SwFont(){ delete pBackColor; }
+
+ SwFont& operator=( const SwFont &rFont );
+
+ inline BYTE GetActual() const { return nActual; }
+ inline void SetActual( BYTE nNew );
+ inline const SvxFont& GetActualFont() const { return aSub[nActual]; }
+
+ // holt sich eine MagicNumber ueber SwFntAccess
+ void GoMagic( ViewShell *pSh, BYTE nWhich );
+ // set background color
+ void SetBackColor( Color* pNewColor );
+ inline const Color* GetBackColor() const{ return pBackColor; }
+
+ inline void ChkMagic( ViewShell *pSh, BYTE nWhich )
+ { if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
+ // uebernimmt die MagicNumber eines (hoffentlich ident.) Kollegen
+ inline void CopyMagic( const SwFont* pFnt, BYTE nWhich )
+ { aSub[nWhich].CopyMagic( pFnt->aSub[nWhich] ); }
+ inline void GetMagic( const void* &rMagic, USHORT &rIdx, BYTE nWhich )
+ { rMagic = aSub[nWhich].pMagic; rIdx = aSub[nWhich].nFntIndex; }
+ inline void SetMagic( const void* pNew, const USHORT nIdx, BYTE nWhich )
+ { aSub[nWhich].pMagic = pNew; aSub[nWhich].nFntIndex = nIdx; }
+ inline BOOL DifferentMagic( const SwFont* pFnt, BYTE nWhich )
+ { return aSub[nWhich].pMagic != pFnt->aSub[nWhich].pMagic ||
+ !aSub[nWhich].pMagic || !pFnt->aSub[nWhich].pMagic; }
+
+ inline const Size &GetSize( BYTE nWhich ) const
+ { return aSub[nWhich].aSize; }
+ inline BOOL IsFntChg() const { return bFntChg; }
+ inline void SetFntChg( const BOOL bNew ) { bFntChg = bNew; }
+
+ // die gekapselten SV-Font-Methoden (setzen bFntChg auf TRUE)
+ inline void SetColor( const Color& rColor );
+ inline void SetFillColor( const Color& rColor );
+ inline void SetAlign( const FontAlign eAlign );
+ inline void SetUnderline( const FontUnderline eUnderline );
+ inline void SetUnderColor( const Color &rColor ) { aUnderColor = rColor; }
+ inline void SetStrikeout( const FontStrikeout eStrikeout );
+ inline void SetOutline( const BOOL bOutline );
+ void SetVertical( USHORT nDir, const BOOL nVertLayout = FALSE );
+ inline void SetShadow( const BOOL bShadow );
+ inline void SetAutoKern( BYTE nAutoKern );
+ inline void SetTransparent( const BOOL bTrans );
+ inline void SetWordLineMode( const BOOL bWordLineMode );
+ inline void SetFixKerning( const short nNewKern );
+ inline void SetCaseMap( const SvxCaseMap eNew );
+ inline void SetEmphasisMark( const FontEmphasisMark eValue );
+
+ // Methoden fuer die Hoch-/Tiefstellung
+ inline void SetEscapement( const short nNewEsc );
+ inline void SetProportion( const BYTE nNewPropr );
+
+ inline void SetPropWidth( const USHORT nNew );
+
+ inline void SetFamily( const FontFamily eFamily, const BYTE nWhich );
+ inline void SetName( const XubString& rName, const BYTE nWhich );
+ inline void SetStyleName( const XubString& rStyleName, const BYTE nWhich );
+ inline void SetSize( const Size& rSize, const BYTE nWhich );
+ inline void SetWeight( const FontWeight eWeight, const BYTE nWhich );
+ inline void SetItalic( const FontItalic eItalic, const BYTE nWhich );
+ inline void SetLanguage( LanguageType eNewLang, const BYTE nWhich );
+ inline void SetCharSet( const CharSet eCharSet, const BYTE nWhich );
+ inline void SetPitch( const FontPitch ePitch, const BYTE nWhich );
+ inline void SetRelief( const FontRelief eNew );
+
+ // Get/Set-Methoden fuer die aktuelle Einstellung
+ inline void SetNoHyph( const BOOL bNew );
+ inline BOOL IsNoHyph() const { return bNoHyph; }
+ inline void SetBlink( const BOOL bBlink );
+ inline BOOL IsBlink() const { return bBlink; }
+ inline BYTE &GetTox() { return nToxCnt; }
+ inline BYTE GetTox() const { return nToxCnt; }
+ inline BOOL IsTox() const { return ( 0 != nToxCnt ); }
+ inline BYTE &GetRef() { return nRefCnt; }
+ inline BYTE GetRef() const { return nRefCnt; }
+ inline BOOL IsRef() const { return ( 0 != nRefCnt ); }
+ inline void SetURL( const BOOL bURL );
+ inline BOOL IsURL() const { return bURL; }
+ inline void SetGreyWave( const BOOL bNew );
+ inline BOOL IsGreyWave() const { return bGreyWave; }
+ inline void SetNoCol( const BOOL bNew );
+ inline BOOL IsNoCol() const { return bNoColReplace; }
+
+ inline void SetPaintBlank( const BOOL bNew );
+ inline BOOL IsPaintBlank() const { return bPaintBlank; }
+ inline void SetPaintWrong( const BOOL bNew );
+ inline BOOL IsPaintWrong() const { return bPaintWrong; }
+
+ // Setzen der Basisklasse Font fuer SwTxtCharFmt
+ void SetDiffFnt( const SfxItemSet* pSet, const SwDoc *pDoc );
+
+ inline const SvxFont &GetFnt( const BYTE nWhich ) const
+ { return aSub[nWhich]; };
+
+ BOOL IsSymbol( ViewShell *pSh )
+ { return aSub[nActual].IsSymbol( pSh ); }
+ FontUnderline GetUnderline() const { return aSub[nActual].GetUnderline(); }
+ const Color& GetUnderColor() const { return aUnderColor; }
+ short GetFixKerning() const { return aSub[nActual].GetFixKerning(); }
+ FontStrikeout GetStrikeout() const { return aSub[nActual].GetStrikeout(); }
+ const Color& GetColor() const { return aSub[nActual].GetColor(); }
+ BOOL IsShadow() const { return aSub[nActual].IsShadow(); }
+ BOOL IsWordLineMode() const { return aSub[nActual].IsWordLineMode(); }
+ BOOL IsOutline() const { return aSub[nActual].IsOutline(); }
+ BOOL IsKerning() const { return aSub[nActual].IsKerning(); }
+ short GetEscapement() const { return aSub[nActual].GetEscapement(); }
+ SvxCaseMap GetCaseMap() const { return aSub[nActual].GetCaseMap(); }
+ BYTE GetPropr() const { return aSub[nActual].GetPropr(); }
+ FontItalic GetItalic() const { return aSub[nActual].GetItalic(); }
+ LanguageType GetLanguage() const { return aSub[nActual].GetLanguage(); }
+ FontAlign GetAlign() const { return aSub[nActual].GetAlign(); }
+ const XubString& GetName() const { return aSub[nActual].GetName(); }
+ const XubString& GetStyleName() const {return aSub[nActual].GetStyleName();}
+ FontFamily GetFamily() const { return aSub[nActual].GetFamily(); }
+ FontPitch GetPitch() const { return aSub[nActual].GetPitch(); }
+ rtl_TextEncoding GetCharSet() const { return aSub[nActual].GetCharSet(); }
+ long GetHeight() const { return aSub[nActual].GetSize().Height(); }
+ FontWeight GetWeight() const { return aSub[nActual].GetWeight(); }
+ FontEmphasisMark GetEmphasisMark() const
+ { return aSub[nActual].GetEmphasisMark(); }
+ USHORT GetPropWidth() const { return aSub[nActual].GetPropWidth(); }
+ USHORT GetOrientation( const BOOL nVertLayout = FALSE ) const;
+
+ inline const XubString& GetName( const BYTE nWhich ) const
+ { return aSub[nWhich].GetName(); }
+ inline LanguageType GetLanguage( const BYTE nWhich ) const
+ { return aSub[nWhich].GetLanguage(); }
+ inline const XubString& GetStyleName( const BYTE nWhich ) const
+ { return aSub[nWhich].GetStyleName(); }
+ inline FontFamily GetFamily( const BYTE nWhich ) const
+ { return aSub[nWhich].GetFamily(); }
+ inline FontItalic GetItalic( const BYTE nWhich ) const
+ { return aSub[nWhich].GetItalic(); }
+ inline FontPitch GetPitch( const BYTE nWhich ) const
+ { return aSub[nWhich].GetPitch(); }
+ inline rtl_TextEncoding GetCharSet( const BYTE nWhich ) const
+ { return aSub[nWhich].GetCharSet(); }
+ inline long GetHeight( const BYTE nWhich ) const
+ { return aSub[nWhich].GetSize().Height(); }
+ inline FontWeight GetWeight( const BYTE nWhich ) const
+ { return aSub[nWhich].GetWeight(); }
+ inline FontEmphasisMark GetEmphasisMark( const BYTE nWhich ) const
+ { return aSub[nWhich].GetEmphasisMark(); }
+
+ // Macht den logischen Font im OutputDevice wirksam.
+ void ChgPhysFnt( ViewShell *pSh, OutputDevice *pOut );
+
+ Size GetCapitalSize( SwDrawTextInfo& rInf )
+ { return aSub[nActual].GetCapitalSize( rInf ); }
+
+
+
+
+
+ void DoOnCapitals( SwDoCapitals &rDo )
+ { aSub[nActual].DoOnCapitals( rDo ); }
+
+ Size _GetTxtSize( SwDrawTextInfo& rInf )
+ { rInf.SetFont( this ); return aSub[nActual]._GetTxtSize( rInf ); }
+
+ xub_StrLen GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth );
+
+
+
+ xub_StrLen _GetCrsrOfst( SwDrawTextInfo& rInf )
+ { return aSub[nActual]._GetCrsrOfst( rInf ); }
+
+
+
+ inline short CheckKerning()
+ { return aSub[nActual].CheckKerning(); }
+ inline USHORT GetAscent( ViewShell *pSh, const OutputDevice *pOut )
+ { return aSub[nActual].GetAscent( pSh, pOut ); }
+ inline USHORT GetHeight( ViewShell *pSh, const OutputDevice *pOut )
+ { return aSub[nActual].GetHeight( pSh, pOut ); }
+ inline void Invalidate()
+ { bFntChg = bOrgChg = TRUE; }
+};
+
+inline void SwFont::SetColor( const Color& rColor )
+{
+ bFntChg = TRUE;
+ aSub[0].SetColor( rColor );
+ aSub[1].SetColor( rColor );
+ aSub[2].SetColor( rColor );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetColor( const Color& rColor )
+{
+ pMagic = 0;
+ Font::SetColor( rColor );
+}
+
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetFillColor( const Color& rColor )
+{
+ pMagic = 0;
+ Font::SetFillColor( rColor );
+}
+
+inline void SwFont::SetFillColor( const Color& rColor )
+{
+ bFntChg = TRUE;
+ aSub[0].SetFillColor( rColor );
+ aSub[1].SetFillColor( rColor );
+ aSub[2].SetFillColor( rColor );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetFamily( const FontFamily eFamily )
+{
+ pMagic = 0;
+ Font::SetFamily( eFamily );
+}
+
+inline void SwFont::SetFamily( const FontFamily eFamily, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetFamily( eFamily );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetName( const XubString& rName )
+{
+ pMagic = 0;
+ Font::SetName( rName );
+}
+
+inline void SwFont::SetName( const XubString& rName, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetName( rName );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetStyleName( const XubString& rStyleName )
+{
+ pMagic = 0;
+ Font::SetStyleName( rStyleName );
+}
+
+inline void SwFont::SetStyleName( const XubString& rStyle, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetStyleName( rStyle );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetCharSet( const CharSet eCharSet )
+{
+ pMagic = 0;
+ Font::SetCharSet( eCharSet );
+}
+
+inline void SwFont::SetCharSet( const CharSet eCharSet, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetCharSet( eCharSet );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetPitch( const FontPitch ePitch )
+{
+ pMagic = 0;
+ Font::SetPitch( ePitch );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwFont::SetPitch( const FontPitch ePitch, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetPitch( ePitch );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetAlign( const FontAlign eAlign )
+{
+ pMagic = 0;
+ Font::SetAlign( eAlign );
+}
+
+inline void SwFont::SetAlign( const FontAlign eAlign )
+{
+ bFntChg = TRUE;
+ aSub[0].SetAlign( eAlign );
+ aSub[1].SetAlign( eAlign );
+ aSub[2].SetAlign( eAlign );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetWeight( const FontWeight eWeight )
+{
+ pMagic = 0;
+ Font::SetWeight( eWeight );
+}
+
+inline void SwFont::SetWeight( const FontWeight eWeight, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetWeight( eWeight );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetUnderline( const FontUnderline eUnderline )
+{
+ pMagic = 0;
+ Font::SetUnderline( eUnderline );
+}
+
+inline void SwFont::SetUnderline( const FontUnderline eUnderline )
+{
+ bFntChg = TRUE;
+ aSub[0].SetUnderline( eUnderline );
+ aSub[1].SetUnderline( eUnderline );
+ aSub[2].SetUnderline( eUnderline );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout )
+{
+ pMagic = 0;
+ Font::SetStrikeout( eStrikeout );
+}
+
+inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout )
+{
+ bFntChg = TRUE;
+ aSub[0].SetStrikeout( eStrikeout );
+ aSub[1].SetStrikeout( eStrikeout );
+ aSub[2].SetStrikeout( eStrikeout );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetItalic( const FontItalic eItalic )
+{
+ pMagic = 0;
+ Font::SetItalic( eItalic );
+}
+
+inline void SwFont::SetItalic( const FontItalic eItalic, const BYTE nWhich )
+{
+ bFntChg = TRUE;
+ aSub[nWhich].SetItalic( eItalic );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetOutline( const BOOL bOutline )
+{
+ pMagic = 0;
+ Font::SetOutline( bOutline );
+}
+
+inline void SwFont::SetOutline( const BOOL bOutline )
+{
+ bFntChg = TRUE;
+ aSub[0].SetOutline( bOutline );
+ aSub[1].SetOutline( bOutline );
+ aSub[2].SetOutline( bOutline );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetShadow( const BOOL bShadow )
+{
+ pMagic = 0;
+ Font::SetShadow( bShadow );
+}
+
+inline void SwFont::SetShadow( const BOOL bShadow )
+{
+ bFntChg = TRUE;
+ aSub[0].SetShadow( bShadow );
+ aSub[1].SetShadow( bShadow );
+ aSub[2].SetShadow( bShadow );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetAutoKern( const BYTE nAutoKern )
+{
+ pMagic = 0;
+ Font::SetKerning( nAutoKern );
+}
+
+inline void SwFont::SetAutoKern( BYTE nAutoKern )
+{
+ bFntChg = TRUE;
+ aSub[1].SetAutoKern( nAutoKern );
+ if( nAutoKern )
+ nAutoKern = KERNING_FONTSPECIFIC;
+ aSub[0].SetAutoKern( nAutoKern );
+ aSub[2].SetAutoKern( nAutoKern );
+}
+
+inline void SwFont::SetTransparent( const BOOL bTrans )
+{
+ aSub[0].SetTransparent( bTrans );
+ aSub[1].SetTransparent( bTrans );
+ aSub[2].SetTransparent( bTrans );
+}
+
+inline void SwFont::SetFixKerning( const short nNewKern )
+{
+ aSub[SW_LATIN].SetFixKerning( nNewKern );
+ aSub[SW_CJK].SetFixKerning( nNewKern );
+ aSub[SW_CTL].SetFixKerning( nNewKern );
+}
+
+inline void SwFont::SetCaseMap( const SvxCaseMap eNew )
+{
+ aSub[SW_LATIN].SetCaseMap( eNew );
+ aSub[SW_CJK].SetCaseMap( eNew );
+ aSub[SW_CTL].SetCaseMap( eNew );
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetWordLineMode( const BOOL bWordLineMode )
+{
+ pMagic = 0;
+ Font::SetWordLineMode( bWordLineMode );
+}
+
+inline void SwFont::SetWordLineMode( const BOOL bWordLineMode )
+{
+ bFntChg = TRUE;
+ aSub[0].SetWordLineMode( bWordLineMode );
+ aSub[1].SetWordLineMode( bWordLineMode );
+ aSub[2].SetWordLineMode( bWordLineMode );
+}
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue )
+{
+ pMagic = 0;
+ Font::SetEmphasisMark( eValue );
+}
+
+inline void SwFont::SetEmphasisMark( const FontEmphasisMark eValue )
+{
+ bFntChg = TRUE;
+ aSub[0].SetEmphasisMark( eValue );
+ aSub[1].SetEmphasisMark( eValue );
+ aSub[2].SetEmphasisMark( eValue );
+}
+
+inline void SwFont::SetPropWidth( const USHORT nNew )
+{
+ if( nNew != aSub[0].GetPropWidth() )
+ {
+ bFntChg = TRUE;
+ aSub[0].SetPropWidth( nNew );
+ aSub[1].SetPropWidth( nNew );
+ aSub[2].SetPropWidth( nNew );
+ }
+}
+
+// gekapselte SV-Font-Methode
+inline void SwSubFont::SetRelief( const FontRelief eNew )
+{
+ pMagic = 0;
+ Font::SetRelief( eNew );
+}
+
+inline void SwFont::SetRelief( const FontRelief eNew )
+{
+ if( eNew != aSub[0].GetRelief() )
+ {
+ bFntChg = TRUE;
+ aSub[0].SetRelief( eNew );
+ aSub[1].SetRelief( eNew );
+ aSub[2].SetRelief( eNew );
+ }
+}
+
+// ueberladene Font-Methode
+inline void SwSubFont::SetSize( const Size& rSize )
+{
+ aSize = rSize;
+ if ( GetPropr() == 100 )
+ Font::SetSize( aSize );
+ else
+ {
+ Font::SetSize( Size(
+ (long) aSize.Width() * GetPropr() / 100L,
+ (long) aSize.Height() * GetPropr() / 100L ) );
+ }
+ pMagic = 0;
+}
+
+inline void SwFont::SetSize( const Size& rSize, const BYTE nWhich )
+{
+ if( aSub[nWhich].aSize != rSize )
+ {
+ aSub[nWhich].SetSize( rSize );
+ bFntChg = TRUE;
+ bOrgChg = TRUE;
+ }
+}
+
+inline void SwFont::SetActual( BYTE nNew )
+{
+ if ( nActual != nNew )
+ {
+ bFntChg = TRUE;
+ bOrgChg = TRUE;
+ nActual = nNew;
+ }
+}
+
+inline void SwSubFont::SetProportion( const BYTE nNewPropr )
+{
+ pMagic = 0;
+ Font::SetSize( Size( (long) aSize.Width() * nNewPropr / 100L,
+ (long) aSize.Height() * nNewPropr / 100L ) );
+ SvxFont::SetPropr( nNewPropr );
+}
+
+inline void SwFont::SetProportion( const BYTE nNewPropr )
+{
+ if( nNewPropr != aSub[0].GetPropr() )
+ {
+ bFntChg = TRUE;
+ bOrgChg = TRUE;
+
+ aSub[0].SetProportion( nNewPropr );
+ aSub[1].SetProportion( nNewPropr );
+ aSub[2].SetProportion( nNewPropr );
+ }
+}
+
+inline void SwSubFont::SetEscapement( const short nNewEsc )
+{
+ pMagic = 0;
+ SvxFont::SetEscapement( nNewEsc );
+}
+
+inline void SwFont::SetEscapement( const short nNewEsc )
+{
+ if( nNewEsc != aSub[0].GetEscapement() )
+ {
+ // these have to be set, otherwise nOrgHeight and nOrgAscent will not
+ // be calculated
+ bFntChg = TRUE;
+ bOrgChg = TRUE;
+
+ aSub[0].SetEscapement( nNewEsc );
+ aSub[1].SetEscapement( nNewEsc );
+ aSub[2].SetEscapement( nNewEsc );
+ }
+}
+
+inline void SwSubFont::SetLanguage( LanguageType eNewLang )
+{
+ if( eNewLang == LANGUAGE_SYSTEM )
+ eNewLang = (LanguageType)GetAppLanguage();
+ SvxFont::SetLanguage( eNewLang );
+}
+
+inline void SwFont::SetLanguage( const LanguageType eNewLang, const BYTE nWhich )
+{
+ aSub[nWhich].SetLanguage( eNewLang );
+ if( SW_CJK == nWhich )
+ {
+ aSub[SW_LATIN].SetCJKContextLanguage( eNewLang );
+ aSub[SW_CJK].SetCJKContextLanguage( eNewLang );
+ aSub[SW_CTL].SetCJKContextLanguage( eNewLang );
+ }
+}
+
+inline void SwFont::SetPaintBlank( const BOOL bNew )
+{
+ bPaintBlank = bNew;
+}
+
+inline void SwFont::SetPaintWrong( const BOOL bNew )
+{
+ bPaintWrong = bNew;
+}
+
+inline void SwFont::SetNoHyph( const BOOL bNew )
+{
+ bNoHyph = bNew;
+}
+
+inline void SwFont::SetBlink( const BOOL bNew )
+{
+ bBlink = bNew;
+}
+
+inline void SwFont::SetURL( const BOOL bNew )
+{
+ bURL = bNew;
+}
+
+inline void SwFont::SetGreyWave( const BOOL bNew )
+{
+ bGreyWave = bNew;
+}
+
+inline void SwFont::SetNoCol( const BOOL bNew )
+{
+ bNoColReplace = bNew;
+}
+
+inline void SwSubFont::SetVertical( const USHORT nDir, const BOOL bVertFormat )
+{
+ pMagic = 0;
+ Font::SetVertical( bVertFormat );
+ Font::SetOrientation( nDir );
+}
+
+
+/*************************************************************************
+ * class SwUnderlineFont
+ *
+ * Used for the "continuous underline" feature.
+ *************************************************************************/
+
+class SwUnderlineFont
+{
+ Point aPos;
+ SwFont* pFnt;
+
+public:
+ // sets the font which should paint the common baseline
+ // and the starting point of the common baseline
+ SwUnderlineFont( SwFont& rFnt, const Point& rPoint );
+ ~SwUnderlineFont();
+
+ SwFont& GetFont()
+ {
+ ASSERT( pFnt, "No underline font" )
+ return *pFnt;
+ }
+ const Point& GetPos() const { return aPos; }
+ // the x coordinate of the starting point has to be set for each portion
+ void SetPos( const Point& rPoint ) { aPos = rPoint; }
+};
+
+
+/*************************************************************************
+ * class SvStatistics
+ *************************************************************************/
+
+#ifndef DBG_UTIL
+#define SV_STAT(nWhich)
+#else
+
+class SvStatistics
+{
+public:
+ USHORT nGetTextSize;
+ USHORT nDrawText;
+ USHORT nGetStretchTextSize;
+ USHORT nDrawStretchText;
+ USHORT nChangeFont;
+ USHORT nGetFontMetric;
+
+ inline void Reset()
+ {
+ nGetTextSize = nDrawText = nGetStretchTextSize =
+ nDrawStretchText = nChangeFont = nGetFontMetric = 0;
+ }
+
+ inline SvStatistics() { Reset(); }
+
+ inline void PrintOn( SvStream &rOS ) const; //$ ostream
+ inline BOOL IsEmpty() const
+ {
+ return !( nGetTextSize || nDrawText ||
+ nDrawStretchText || nChangeFont || nGetFontMetric );
+ }
+};
+
+// globale Variable, implementiert in swfont.cxx
+extern SvStatistics aSvStat;
+
+#define SV_STAT(nWhich) ++(aSvStat.nWhich);
+
+inline void SvStatistics::PrintOn( SvStream &rOS ) const //$ ostream
+{
+ if( IsEmpty() )
+ return;
+
+ rOS << "{ SV called:" << '\n';
+ if( nGetTextSize )
+ rOS << "\tnGetTextSize: " << nGetTextSize << '\n'; if( nDrawText )
+ rOS << "\tnDrawText: " << nDrawText << '\n'; if( nGetStretchTextSize )
+ rOS << "\tnGetStretchTextSize: " << nGetStretchTextSize << '\n'; if( nDrawStretchText )
+ rOS << "\tnDrawStretchText: " << nDrawStretchText << '\n'; if( nChangeFont )
+ rOS << "\tnChangeFont: " << nChangeFont << '\n'; if( nGetFontMetric )
+ rOS << "\tnGetFontMetric: " << nGetFontMetric << '\n'; rOS << "}" << '\n'; }
+#endif /* PRODUCT */
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/tabfrm.hxx b/binfilter/bf_sw/source/core/inc/tabfrm.hxx
new file mode 100644
index 000000000000..0bf94d0e0b54
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/tabfrm.hxx
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TABFRM_HXX
+#define _TABFRM_HXX
+
+#include <tools/mempool.hxx>
+#include "layfrm.hxx"
+#include "flowfrm.hxx"
+namespace binfilter {
+
+class SwTable;
+class SwBorderAttrs;
+class SwAttrSetChg;
+
+class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
+{
+ // OD 14.03.2003 #i11760# - adjustment, because of method signature change
+ //darf mit den Flags spielen.
+ friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
+
+ //Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch.
+ SwLayoutFrm *GetLeaf( MakePageType eMakePage, BOOL bFwd );
+
+ SwTable *pTable;
+
+ BOOL bComplete :1; //Eintrage als Repaint ohne das CompletePaint
+ //der Basisklasse gesetzt werden muss. Damit
+ //sollen unertraegliche Tabellen-Repaints
+ //vermieden werden.
+ BOOL bCalcLowers :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
+ //des Inhaltes sorgen.
+ BOOL bLowersFormatted :1;//Kommunikation zwischen MakeAll und Layact
+ BOOL bLockBackMove :1; //BackMove-Test hat der Master erledigt.
+ BOOL bResizeHTMLTable :1; //Resize des HTMLTableLayout rufen im MakeAll
+ //Zur Optimierung, damit dies nicht im
+ //CntntFrm::Grow gerufen werden muss, denn dann
+ //wird es ggf. fuer jede Zelle gerufen #47483#
+ BOOL bONECalcLowers :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
+ //die Cntnts auf jedenfall per Calc() formatiert.
+ //es finden keine zusaetzlichen Invalidierungen
+ //statt und dieser Weg kann auch kaum garantien
+ //geben.
+
+ //Split() spaltet den Frm an der angegebenen Stelle, es wird ein
+ //Follow erzeugt und aufgebaut und direkt hinter this gepastet.
+ //Join() Holt sich den Inhalt aus dem Follow und vernichtet diesen.
+ SwTwips Split( const SwTwips nCutPos );
+ SwTwips Join();
+
+ void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+
+ virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
+
+protected:
+ virtual void MakeAll();
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ //Aendert nur die Framesize, nicht die PrtArea-SSize
+ virtual SwTwips GrowFrm ( SwTwips, SZPTR
+ BOOL bTst = FALSE, BOOL bInfo = FALSE );
+public:
+ SwTabFrm( SwTable & ); //Immer nach dem erzeugen _und_ pasten das
+ //Regist Flys rufen!
+ SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows
+ ~SwTabFrm();
+
+
+ //Ruft das RegistFlys der Zeilen.
+ void RegistFlys();
+
+ inline const SwTabFrm *GetFollow() const;
+ inline SwTabFrm *GetFollow();
+ inline const SwTabFrm *FindMaster() const;
+ inline SwTabFrm *FindMaster();
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual BOOL GetInfo( SfxPoolItem &rHnt ) const;
+ virtual void CheckDirection( BOOL bVert );
+
+ virtual void Cut();
+ virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+
+ virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
+ const void *pVoid = 0, sal_Bool bNotify = sal_True );
+
+ SwCntntFrm *FindLastCntnt();
+ inline const SwCntntFrm *FindLastCntnt() const;
+
+ const SwTable *GetTable() const { return pTable; }
+ SwTable *GetTable() { return pTable; }
+
+ BOOL IsComplete() { return bComplete; }
+ void SetComplete() { bComplete = TRUE; }
+ void ResetComplete() { bComplete = FALSE; }
+
+ BOOL IsLowersFormatted() const { return bLowersFormatted; }
+ void SetLowersFormatted( BOOL b ) { bLowersFormatted = b; }
+
+ void SetCalcLowers() { bCalcLowers = TRUE; } //Sparsam einsetzen!
+ void SetResizeHTMLTable() { bResizeHTMLTable = TRUE; } //dito
+ void SetONECalcLowers() { bONECalcLowers = TRUE; }
+
+ BOOL CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
+ long& rRightOffset ) const;
+ DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
+};
+
+inline const SwCntntFrm *SwTabFrm::FindLastCntnt() const
+{
+ return ((SwTabFrm*)this)->FindLastCntnt();
+}
+
+inline const SwTabFrm *SwTabFrm::GetFollow() const
+{
+ return (const SwTabFrm*)SwFlowFrm::GetFollow();
+}
+inline SwTabFrm *SwTabFrm::GetFollow()
+{
+ return (SwTabFrm*)SwFlowFrm::GetFollow();
+}
+
+inline const SwTabFrm *SwTabFrm::FindMaster() const
+{
+ return (const SwTabFrm*)SwFlowFrm::FindMaster();
+}
+inline SwTabFrm *SwTabFrm::FindMaster()
+{
+ return (SwTabFrm*)SwFlowFrm::FindMaster();
+}
+
+} //namespace binfilter
+#endif //_TABFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/tblrwcl.hxx b/binfilter/bf_sw/source/core/inc/tblrwcl.hxx
new file mode 100644
index 000000000000..1f7c2eab6924
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/tblrwcl.hxx
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TBLRWCL_HXX
+#define _TBLRWCL_HXX
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#include <bf_svtools/svstdarr.hxx>
+#endif
+
+#include <swtypes.hxx>
+#include <tblsel.hxx>
+#include <swtable.hxx>
+namespace binfilter {
+
+class SfxPoolItem;
+class SvxBorderLine;
+class SwDoc;
+class SwTableNode;
+class _FndLine;
+class _FndBox;
+class SwTableLine;
+class SwTableBox;
+class SwTableBoxFmt;
+class SwTableLineFmt;
+class SwHistory;
+class SwCntntNode;
+
+class SwShareBoxFmts;
+class SwFmtFrmSize;
+
+// Funktions Deklarationen:
+BOOL lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara );
+BOOL lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara );
+
+BOOL lcl_MergeGCBox( const SwTableBox*& rpBox, void* pPara );
+BOOL lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara );
+
+BOOL lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara );
+BOOL lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara );
+
+BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara );
+BOOL lcl_CopyLineToDoc( const _FndLine*& rpFndLn, void* pPara );
+
+BOOL lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara );
+BOOL lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara );
+
+
+#ifdef DBG_UTIL
+#endif
+
+void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
+ SwTableLine* pLine, SwTableBoxFmt* pBoxFrmFmt,
+ SwTableBox* pBox, USHORT nInsPos, USHORT nCnt = 1 );
+
+void _DeleteBox( SwTable& rTbl, SwTableBox* pBox,
+ BOOL bCalcNewSize = TRUE, const BOOL bCorrBorder = TRUE,
+ SwShareBoxFmts* pShareFmts = 0 );
+
+// Klasse fuers SplitTable
+// sammelt von einer Line die Boxen aller obersten oder untersten Lines
+// in einem Array. Zusaetzlich werden die Positionen vermerkt.
+// ( die Implementierung steht im ndtbl.cxx)
+
+ class SwCollectTblLineBoxes
+ {
+ SvUShorts aPosArr;
+ SwSelBoxes_SAR aBoxes;
+ SwHistory* pHst;
+ USHORT nMode, nWidth;
+ BOOL bGetFromTop : 1;
+ BOOL bGetValues : 1;
+
+ public:
+ SwCollectTblLineBoxes( BOOL bTop, USHORT nMd = 0, SwHistory* pHist=0 )
+ : aPosArr( 16, 16 ), aBoxes( 16, 16 ),
+ bGetFromTop( bTop ), bGetValues( TRUE ), nMode( nMd ),
+ nWidth( 0 ), pHst( pHist )
+ {}
+
+ void AddBox( const SwTableBox& rBox );
+ const SwTableBox* GetBoxOfPos( const SwTableBox& rBox );
+
+ USHORT Count() const { return aBoxes.Count(); }
+ const SwTableBox& GetBox( USHORT nPos, USHORT* pWidth = 0 ) const
+ {
+ // hier wird die EndPos der Spalte benoetigt!
+ if( pWidth )
+ *pWidth = nPos+1 == aPosArr.Count() ? nWidth
+ : aPosArr[ nPos+1 ];
+ return *aBoxes[ nPos ];
+ }
+
+ BOOL IsGetFromTop() const { return bGetFromTop; }
+ BOOL IsGetValues() const { return bGetValues; }
+
+ USHORT GetMode() const { return nMode; }
+ void SetValues( BOOL bFlag ) { bGetValues = FALSE; nWidth = 0;
+ bGetFromTop = bFlag; }
+ FASTBOOL Resize( USHORT nOffset, USHORT nWidth );
+ };
+
+BOOL lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara );
+BOOL lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara );
+
+BOOL lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara );
+
+struct _SwGCLineBorder
+{
+ const SwTableLines* pLines;
+ SwShareBoxFmts* pShareFmts;
+ USHORT nLinePos;
+
+ _SwGCLineBorder( const SwTable& rTable )
+ : pLines( &rTable.GetTabLines() ), nLinePos( 0 ), pShareFmts(0) {}
+
+ _SwGCLineBorder( const SwTableBox& rBox )
+ : pLines( &rBox.GetTabLines() ), nLinePos( 0 ), pShareFmts(0) {}
+ BOOL IsLastLine() const { return nLinePos + 1 >= pLines->Count(); }
+};
+
+class _SwGCBorder_BoxBrd
+{
+ const SvxBorderLine* pBrdLn;
+ BOOL bAnyBorderFnd;
+public:
+ _SwGCBorder_BoxBrd() : pBrdLn( 0 ), bAnyBorderFnd( FALSE ) {}
+
+ void SetBorder( const SvxBorderLine& rBorderLine )
+ { pBrdLn = &rBorderLine; bAnyBorderFnd = FALSE; }
+
+ // checke, ob die linke Border dieselbe wie die gesetzte ist
+ // returnt FALSE falls gar keine Border gesetzt ist
+ BOOL CheckLeftBorderOfFormat( const SwFrmFmt& rFmt );
+
+ BOOL IsAnyBorderFound() const { return bAnyBorderFnd; }
+};
+
+BOOL lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
+BOOL lcl_GC_Box_Border( const SwTableBox*& , void* pPara );
+
+BOOL lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& , void* pPara );
+BOOL lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& , void* pPara );
+
+BOOL lcl_GCBorder_GetLastBox_L( const SwTableLine*& , void* pPara );
+BOOL lcl_GCBorder_GetLastBox_B( const SwTableBox*& , void* pPara );
+
+
+class SwShareBoxFmt
+{
+ const SwFrmFmt* pOldFmt;
+ SvPtrarr aNewFmts;
+
+public:
+ SwShareBoxFmt( const SwFrmFmt& rFmt )
+ : pOldFmt( &rFmt ), aNewFmts( 1, 4 )
+ {}
+
+ const SwFrmFmt& GetOldFormat() const { return *pOldFmt; }
+
+ SwFrmFmt* GetFormat( long nWidth ) const;
+ SwFrmFmt* GetFormat( const SfxPoolItem& rItem ) const;
+ void AddFormat( const SwFrmFmt& rFmt );
+//STRIP001 // returnt TRUE, wenn geloescht werden kann
+ FASTBOOL RemoveFormat( const SwFrmFmt& rFmt );
+};
+
+
+SV_DECL_PTRARR_DEL( _SwShareBoxFmts, SwShareBoxFmt*, 8, 8 )
+
+class SwShareBoxFmts
+{
+ _SwShareBoxFmts aShareArr;
+ BOOL Seek_Entry( const SwFrmFmt& rFmt, USHORT* pPos ) const;
+
+ void ChangeFrmFmt( SwTableBox* pBox, SwTableLine* pLn, SwFrmFmt& rFmt );
+public:
+ SwShareBoxFmts() {}
+ ~SwShareBoxFmts();
+
+ SwFrmFmt* GetFormat( const SwFrmFmt& rFmt, long nWidth ) const;
+ SwFrmFmt* GetFormat( const SwFrmFmt& rFmt, const SfxPoolItem& ) const;
+ void AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew );
+ void SetSize( SwTableBox& rBox, const SwFmtFrmSize& rSz );
+ void SetAttr( SwTableBox& rBox, const SfxPoolItem& rItem );
+ void RemoveFormat( const SwFrmFmt& rFmt );
+};
+
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/toxhlp.hxx b/binfilter/bf_sw/source/core/inc/toxhlp.hxx
new file mode 100644
index 000000000000..97ff27b9a365
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/toxhlp.hxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TOXHLP_HXX
+#define _TOXHLP_HXX
+
+#include <tools/solar.h>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+
+namespace drafts { namespace com { namespace sun { namespace star {
+namespace i18n {
+ class XExtendedIndexEntrySupplier;
+}
+namespace lang {
+ class XMultiServiceFactory;
+}
+}}}};
+namespace binfilter {
+
+
+
+ class IndexEntrySupplierWrapper
+ {
+ STAR_NMSPC::lang::Locale aLcl;
+ STAR_NMSPC::uno::Reference < ::com::sun::star::i18n::XExtendedIndexEntrySupplier > xIES;
+
+ public:
+ IndexEntrySupplierWrapper(
+ const STAR_NMSPC::lang::Locale& rLcl,
+ STAR_REFERENCE( lang::XMultiServiceFactory )& rxMSF );
+ ~IndexEntrySupplierWrapper();
+
+ STAR_NMSPC::uno::Sequence< ::rtl::OUString >
+ GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLcl ) const;
+
+ sal_Bool LoadAlgorithm( const STAR_NMSPC::lang::Locale& rLcl,
+ const String& sSortAlgorithm, long nOptions ) const;
+
+ sal_Int16 CompareIndexEntry( const String& rTxt1, const String& rTxtReading1,
+ const STAR_NMSPC::lang::Locale& rLcl1,
+ const String& rTxt2, const String& rTxtReading2,
+ const STAR_NMSPC::lang::Locale& rLcl2 ) const;
+ };
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/txmsrt.hxx b/binfilter/bf_sw/source/core/inc/txmsrt.hxx
new file mode 100644
index 000000000000..e69afd0e07c1
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/txmsrt.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TXMSRT_HXX
+#define _TXMSRT_HXX
+
+#include <i18npool/lang.h>
+#include <tox.hxx>
+class CharClass;
+namespace binfilter {
+
+
+class SwCntntNode;
+class SwTxtNode;
+class SwTxtTOXMark;
+class SwIndex;
+class SwFmtFld;
+class IndexEntrySupplierWrapper;
+
+enum TOXSortType
+{
+ TOX_SORT_INDEX,
+ TOX_SORT_CUSTOM,
+ TOX_SORT_CONTENT,
+ TOX_SORT_PARA,
+ TOX_SORT_TABLE,
+ TOX_SORT_AUTHORITY
+};
+
+struct SwTOXSource
+{
+ const SwCntntNode* pNd;
+ xub_StrLen nPos;
+ BOOL bMainEntry;
+
+ SwTOXSource() : pNd(0), nPos(0), bMainEntry(FALSE) {}
+ SwTOXSource( const SwCntntNode* pNode, xub_StrLen n, BOOL bMain )
+ : pNd(pNode), nPos(n), bMainEntry(bMain)
+ {}
+};
+
+SV_DECL_VARARR( SwTOXSources, SwTOXSource, 0, 10 )
+
+class SwTOXInternational
+{
+ IndexEntrySupplierWrapper* pIndexWrapper;
+ CharClass* pCharClass;
+ LanguageType eLang;
+ String sSortAlgorithm;
+ USHORT nOptions;
+
+ void Init();
+
+public:
+ SwTOXInternational( LanguageType nLang, USHORT nOptions,
+ const String& rSortAlgorithm );
+ SwTOXInternational( const SwTOXInternational& );
+ ~SwTOXInternational();
+
+ sal_Int32 Compare( const String& rTxt1, const String& rTxtReading1,
+ const ::com::sun::star::lang::Locale& rLocale1,
+ const String& rTxt2, const String& rTxtReading2,
+ const ::com::sun::star::lang::Locale& rLocale2 ) const;
+
+ inline BOOL IsEqual( const String& rTxt1, const String& rTxtReading1,
+ const ::com::sun::star::lang::Locale& rLocale1,
+ const String& rTxt2, const String& rTxtReading2,
+ const ::com::sun::star::lang::Locale& rLocale2 ) const
+ {
+ return 0 == Compare( rTxt1, rTxtReading1, rLocale1,
+ rTxt2, rTxtReading2, rLocale2 );
+ }
+ inline BOOL IsNumeric( const String& rStr ) const;
+};
+
+/*--------------------------------------------------------------------
+ Beschreibung: Klassen fuer die Sortierung der Verzeichnisse
+ --------------------------------------------------------------------*/
+
+struct SwTOXSortTabBase
+{
+ SwTOXSources aTOXSources;
+ ::com::sun::star::lang::Locale aLocale;
+ const SwTxtNode* pTOXNd;
+ const SwTxtTOXMark* pTxtMark;
+ const SwTOXInternational* pTOXIntl;
+ ULONG nPos;
+ xub_StrLen nCntPos;
+ USHORT nType;
+ static USHORT nOpt;
+
+ SwTOXSortTabBase( TOXSortType nType,
+ const SwCntntNode* pTOXSrc,
+ const SwTxtTOXMark* pTxtMark,
+ const SwTOXInternational* pIntl,
+ const ::com::sun::star::lang::Locale* pLocale = NULL );
+
+ USHORT GetType() const { return nType; }
+ USHORT GetOptions() const { return nOpt; }
+
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0) const;
+ virtual USHORT GetLevel() const = 0;
+ virtual BOOL operator==( const SwTOXSortTabBase& );
+ virtual BOOL operator<( const SwTOXSortTabBase& );
+
+ virtual String GetURL() const;
+
+ inline void GetTxt( String&, String& ) const;
+ inline const ::com::sun::star::lang::Locale& GetLocale() const;
+
+private:
+ BOOL bValidTxt;
+ String sSortTxt;
+ String sSortTxtReading;
+
+ virtual void _GetText( String&, String& ) = 0;
+};
+
+inline void SwTOXSortTabBase::GetTxt( String& rSortTxt,
+ String& rSortTxtReading ) const
+{
+ if( !bValidTxt )
+ {
+ SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this;
+ pThis->_GetText( pThis->sSortTxt, pThis->sSortTxtReading );
+ pThis->bValidTxt = TRUE;
+ }
+
+ rSortTxt = sSortTxt;
+ rSortTxtReading = sSortTxtReading;
+ }
+
+ inline const ::com::sun::star::lang::Locale& SwTOXSortTabBase::GetLocale() const
+ {
+ return aLocale;
+ }
+
+/*--------------------------------------------------------------------
+ Beschreibung: fuer Sortierung nach Text
+ --------------------------------------------------------------------*/
+
+
+
+/*--------------------------------------------------------------------
+ Beschreibung: fuer Sortierung nach Position
+ --------------------------------------------------------------------*/
+
+
+
+
+struct SwTOXAuthority : public SwTOXSortTabBase
+{
+private:
+ SwFmtFld& m_rField;
+ virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
+ virtual void _GetText( String&, String& );
+
+public:
+ SwTOXAuthority( const SwCntntNode& rNd, SwFmtFld& rField, const SwTOXInternational& rIntl );
+ SwFmtFld& GetFldFmt() {return m_rField;}
+
+ virtual BOOL operator==( const SwTOXSortTabBase& );
+ virtual BOOL operator<( const SwTOXSortTabBase& );
+ virtual USHORT GetLevel() const;
+};
+
+
+} //namespace binfilter
+#endif // _TXMSRT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/txtfrm.hxx b/binfilter/bf_sw/source/core/inc/txtfrm.hxx
new file mode 100644
index 000000000000..cd89ef7acf0b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/txtfrm.hxx
@@ -0,0 +1,707 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TXTFRM_HXX
+#define _TXTFRM_HXX
+
+#include <tools/mempool.hxx>
+#include <tools/string.hxx>
+#include "cntfrm.hxx"
+/*N*/ #include <tools/debug.hxx> //for stripping
+class OutputDevice;
+namespace binfilter {
+#define STRSIZE(x) (sizeof(x)-1)
+
+class SwCharRange;
+class SwTxtNode;
+class SwTxtFormatter;
+class SwTxtFormatInfo;
+class SwParaPortion;
+class WidowsAndOrphans;
+class SwBodyFrm;
+class SwFooterFrm;
+class SwTxtFtn;
+class SwInterHyphInfo; // Hyphenate()
+class SwCache;
+class SwBorderAttrs;
+class SwFrmFmt;
+class SwFldPortion;
+
+class SwTestFormat;
+class SwStripes;
+struct SwCrsrMoveState;
+struct SwFillData;
+class SwPortionHandler;
+class SwScriptInfo;
+
+#define GRID_ON 0
+#define GRID_HEIGHT 1
+#define RUBY_HEIGHT 2
+#define RUBY_TOP 3
+#define GRID_CELLS 4
+
+class SwTxtFrm: public SwCntntFrm
+{
+ friend class SwTxtIter;
+ friend class SwTestFormat;
+ friend class WidowsAndOrphans;
+ friend class SwTxtFrmLocker; // duerfen Lock()/Unlock()
+
+ static SwCache *pTxtCache; //Pointer auf den Line-Cache
+ static long nMinPrtLine; //Diese Linie darf beim Drucken nicht
+ //unterschritten werden, Hack fuer Tabellenzellen ueber mehrere Seiten
+
+ ULONG nAllLines :24;//Anzahl der Zeilen fuer das Paint (inkl. nThisLines)
+ ULONG nThisLines :8; //Anzahl der Zeilen dieses Frames
+
+ // The x position for flys anchored at this paragraph.
+ // These values are calculated in SwTxtFrm::CalcBaseOfstForFly()
+ SwTwips mnFlyAnchorOfst;
+ // The x position for wrap-through flys anchored at this paragraph.
+ SwTwips mnFlyAnchorOfstNoWrap;
+
+ xub_StrLen nOfst; //nOfst gibt den Offset im Cntnt (Anzahl Zeichen) an.
+
+ USHORT nCacheIdx; //Index in den Cache, USHRT_MAX wenn definitiv
+ //kein passendes Objekt im Cache steht.
+
+ //Teilt den Master ab und erzeugt einen Follow oder passt die
+ //Daten im Follow an.
+ void _AdjustFollow( SwTxtFormatter &rLine, const xub_StrLen nOffset,
+ const xub_StrLen nStrEnd, const sal_uInt8 nMode );
+ inline void AdjustFollow( SwTxtFormatter &rLine, const xub_StrLen nOffset,
+ const xub_StrLen nStrEnd, const sal_uInt8 nMode );
+
+ //Iteriert ueber alle Zeilen und stellt das Linespacing
+ //entsprechend dem Attribut ein.
+ void CalcLineSpace();
+
+ void InitCtor(); // Wird in beiden Ctoren gerufen
+
+ // Wird nur in Format gerufen:
+ void AdjustFrm( const SwTwips nChgHeight, sal_Bool bHasToFit = sal_False );
+
+ // wertet in Format() die Preps aus.
+ sal_Bool CalcPreps();
+ void PrepWidows( const USHORT nNeed, sal_Bool bNotify = sal_True );
+ void _InvalidateRange( const SwCharRange &, const long = 0);
+ inline void InvalidateRange( const SwCharRange &, const long = 0);
+
+ // WidowsAndOrphans, AdjustFrm, AdjustFollow
+ void FormatAdjust( SwTxtFormatter &rLine, WidowsAndOrphans &rFrmBreak,
+ const xub_StrLen nStrLen, const sal_Bool bDummy );
+
+ sal_Bool bLocked : 1; // im Format?
+ sal_Bool bFormatted : 1; // nach Format auf sal_True
+ sal_Bool bWidow : 1; // sind wir ein Widow
+ sal_Bool bJustWidow : 1; // haben wir soeben Widow angefordert
+ sal_Bool bEmpty : 1; // sind wir ein leerer Absatz
+ sal_Bool bInFtnConnect : 1; // Steht gerade im Connect
+ sal_Bool bFtn : 1; // Hat mindestens eine Fussnote
+ sal_Bool bRepaint : 1; // TxtFrm: Repaint steht zur Abholung bereit
+ sal_Bool bBlinkPor : 1; // enthaelt Blink-Portions
+ sal_Bool bFieldFollow : 1; // beginne mit Feldrest des Masters
+ sal_Bool bHasAnimation : 1; // enthaelt animierte SwGrfNumPortion
+ sal_Bool bIsSwapped : 1; // during text formatting we swap the
+ // width and height for vertical formatting
+ // OD 14.03.2003 #i11760# - flag to control, if follow is formatted in
+ // method <CalcFollow(..)>.
+ // E.g., avoid formatting of follow, if method <SwLayoutFrm::FormatWidthCols(..)>
+ // is running.
+ sal_Bool mbFollowFormatAllowed : 1;
+
+ void ResetPreps();
+ inline void Lock() { bLocked = sal_True; }
+ inline void Unlock() { bLocked = sal_False; }
+ inline void SetFormatted( const sal_Bool bNew ) { bFormatted = bNew; }
+ inline void SetWidow( const sal_Bool bNew ) { bWidow = bNew; }
+ inline void SetJustWidow( const sal_Bool bNew ) { bJustWidow = bNew; }
+ inline void SetEmpty( const sal_Bool bNew ) { bEmpty = bNew; }
+ inline void SetFieldFollow( const sal_Bool bNew ) { bFieldFollow = bNew; }
+
+ sal_Bool IsIdxInside( const xub_StrLen nPos, const xub_StrLen nLen ) const;
+
+ // Wechselt den Frame oder auch nicht (vgl. FlyCnt)
+ sal_Bool _GetCrsrOfst(SwPosition *pPos, const Point &rPoint,
+ const sal_Bool bChgFrm, const SwCrsrMoveState* = 0 ) const;
+
+ // formatiert genau eine Zeile ...
+ sal_Bool FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev );
+
+ // Um Stack einzusparen aufgeteilt ...
+ // _Format ruft _Format mit Parametern
+ void _Format( SwParaPortion *pPara );
+ void _Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
+ const sal_Bool bAdjust = sal_False );
+ void FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf );
+
+ // formatiert den Follow und sorgt fuer die Entsorgung bei Orphans
+ sal_Bool CalcFollow( const xub_StrLen nTxtOfst );
+
+ // korrigiert die Stelle ab der formatiert werden muss.
+ xub_StrLen FindBrk(const String &rTxt, const xub_StrLen nStart,
+ const xub_StrLen nEnd) const;
+
+ // inline-Weiche
+ SwTwips _GetFtnFrmHeight() const;
+
+ // Aus CalcPreps ausgelagert.
+ sal_Bool CalcPrepFtnAdjust();
+
+ // Fuer Ftn und WidOrp: Zwangsvalidierung
+ void ValidateFrm();
+ void ValidateBodyFrm();
+
+
+ void SetPara( SwParaPortion *pNew, sal_Bool bDelete = sal_True );
+
+ sal_Bool _IsFtnNumFrm() const;
+
+ // 6995: Formatinformationen auffrischen
+ sal_Bool FormatQuick();
+
+ // Opt: Leere Absaetze formatieren
+ sal_Bool FormatEmpty();
+ SwTwips EmptyHeight() const;
+ // Opt: Leere Absaetze painten
+
+ void ChgThisLines();//Muss immer gerufen werden, wenn sich die Zeilenazahl
+ //veraendert haben kann.
+
+ // required for 'new' relative anchor position
+ void CalcBaseOfstForFly();
+
+public:
+
+ //public, weil der eine oder andere die Methode rufen darf um das
+ //Prepare zu sparen - mit Vorsicht zu geniessen!
+ void Init();
+
+ // Wird von FormatSpelling( ) gerufen
+ SwRect _AutoSpell( SwCntntNode* , USHORT );
+ // Wird vom CollectAutoCmplWords gerufen
+ void CollectAutoCmplWrds( SwCntntNode* , USHORT , sal_Bool bIsVisArea );
+
+ // Returns the screen position of rPos. The values are relative to the upper
+ // left position of the page frame.
+ // Additional information can be obtained by passing an SwCrsrMoveState object.
+ // Returns sal_False if rPos > number of character is string
+ virtual sal_Bool GetCharRect( SwRect& rRect, const SwPosition& rPos,
+ SwCrsrMoveState* pCMS = 0 ) const;
+ // Eine etwas abgespeckte GetCharRect-Version fuer autopositionierte Rahmen
+ sal_Bool GetAutoPos( SwRect &, const SwPosition& ) const;
+
+ //Liefert in nOffset den Offset des Characters innerhalb des
+ //gesetzten Textbuffers zurueck, welcher der durch aPoint
+ //gegebenen Position innerhalb der SSize des Layout am
+ //naechsten ist. Wenn der SPoint ausserhalb der SSize liegt,
+ //liefert die Funktion sal_False, sal_True sonst.
+ virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
+ const SwCrsrMoveState* = 0) const;
+
+ // GetKeyCrsrOfst sorgt dafuer, dass der Frame nicht gewechselt wird
+ // (z.B. Wechsel in den zeichengebundenen Frame).
+ inline sal_Bool GetKeyCrsrOfst(SwPosition *pPos, const Point &rPoint ) const
+ { return _GetCrsrOfst( pPos, rPoint, sal_False ); }
+
+ SwRect Paint();
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual sal_Bool GetInfo( SfxPoolItem & ) const;
+
+ //Layoutorientiertes Cursortravelling: Linker, rechter Rand,
+ //vorhergehende/naechste Zeile, gleiche horizontale Position.
+
+
+ // Prepares the cursor position for a visual cursor move (BiDi).
+ // The behaviour is different for insert and overwrite cursors
+ void PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
+ sal_Bool& bRight, sal_Bool bInsertCrsr );
+
+ // Methoden zur Verwaltung von FolgeFrames
+ SwCntntFrm *SplitFrm( const xub_StrLen nTxtPos );
+ SwCntntFrm *JoinFrm();
+ inline USHORT GetOfst() const { return nOfst; }
+ void _SetOfst( const USHORT nNewOfst );
+ inline void SetOfst ( const USHORT nNewOfst );
+ inline void ManipOfst ( const USHORT nNewOfst ){ nOfst = nNewOfst; }
+ SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos);
+ inline const SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos) const;
+ SwTxtFrm *GetFrmAtOfst( const xub_StrLen nOfst );
+ // Wenn es einen Follow gibt und wir selbst keinen Text enthalten:
+ inline sal_Bool IsEmptyMaster() const
+ { return GetFollow() && !GetFollow()->GetOfst(); }
+
+ // Liefert den zu bearbeitenden Textausschnitt zurueck (inline, s.u.)
+ const String& GetTxt() const;
+ inline SwTxtNode *GetTxtNode()
+ { return (SwTxtNode*)SwCntntFrm::GetNode(); }
+ inline const SwTxtNode *GetTxtNode() const
+ { return (SwTxtNode*)SwCntntFrm::GetNode(); }
+
+ SwTxtFrm(SwTxtNode * const);
+ inline ~SwTxtFrm() { if( HasAnimation() ) ClearPara(); }
+
+ // SwCntntFrm: der "kurze Dienstweg" fuer die Frames.
+ // Wer den void* falsch casted ist selbst Schuld!
+ // Auf jedenfall muss der void* auf 0 geprueft werden.
+ virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
+ const void *pVoid = 0, sal_Bool bNotify = sal_True );
+
+ //nMaxHeight liefert die benoetigte Hoehe,
+ //bSplit sagt, obj der Absatz gesplittet werden muss.
+ virtual sal_Bool WouldFit( SwTwips &nMaxHeight, sal_Bool &bSplit );
+
+ // Hier das WouldFit-Aequivalent fuer mal kurz probeweise
+ // umgehaengte TextFrames, auch hier liefert
+ // nMaxHeight die benoetigte Hoehe,
+ // und bSplit sagt, obj der Absatz gesplittet werden muss.
+ // Uebergeben wird der potentielle Vorgaenger fuer die Abstandsberechnung
+ sal_Bool TestFormat( const SwFrm* pPrv, SwTwips &nMaxHeight, sal_Bool &bSplit );
+
+ // Wir formatieren eine Zeile fuer die interaktive Trennung
+ // Return: found
+
+ // Probegrow
+ inline SwTwips GrowTst( const SwTwips nGrow );
+
+ SwParaPortion *GetPara();
+ inline const SwParaPortion *GetPara() const;
+ inline sal_Bool HasPara() const;
+ sal_Bool _HasPara() const;
+ // If there are any hanging punctuation portions in the margin
+ // the offset will be returned.
+ SwTwips HangingMargin() const;
+
+ // RTTI
+ TYPEINFO();
+ DECL_FIXEDMEMPOOL_NEWDEL(SwTxtFrm)
+
+ // Locking
+ inline sal_Bool IsLocked() const { return bLocked; }
+ inline sal_Bool IsFormatted() const { return bFormatted; }
+
+ inline sal_Bool IsWidow() const { return bWidow; }
+ inline sal_Bool IsJustWidow() const { return bJustWidow; }
+ inline sal_Bool IsEmpty() const { return bEmpty; }
+ inline sal_Bool HasFtn() const { return bFtn; }
+ inline sal_Bool IsInFtnConnect()const { return bInFtnConnect;}
+ inline sal_Bool IsFieldFollow() const { return bFieldFollow;}
+
+ inline void SetRepaint() const;
+ inline void ResetRepaint() const;
+ inline sal_Bool HasRepaint() const { return bRepaint; }
+ inline void SetBlinkPor() const;
+ inline void ResetBlinkPor() const;
+ inline sal_Bool HasBlinkPor() const { return bBlinkPor; }
+ inline void SetAnimation() const
+ { ( (SwTxtFrm*)this )->bHasAnimation = sal_True; }
+ inline sal_Bool HasAnimation() const { return bHasAnimation; }
+
+ inline sal_Bool IsSwapped() const { return bIsSwapped; }
+
+ // Hat der Frm eine lokale Fussnote (in diesem Frm bzw. Follow)?
+#ifndef DBG_UTIL
+ void CalcFtnFlag();
+#else
+ void CalcFtnFlag( xub_StrLen nStop = STRING_LEN );//Fuer den Test von SplitFrm
+#endif
+
+ // Hidden
+ sal_Bool IsHiddenNow() const; // bHidden && pOut == pPrt
+ void HideHidden(); // Anhaengsel entfernen wenn Hidden
+
+ // Ftn
+ void RemoveFtn( const xub_StrLen nStart = 0,
+ const xub_StrLen nLen = STRING_LEN );
+ inline SwTwips GetFtnFrmHeight() const;
+ SwTxtFrm *FindFtnRef( const SwTxtFtn *pFtn );
+ inline const SwTxtFrm *FindFtnRef( const SwTxtFtn *pFtn ) const
+ { return FindFtnRef( pFtn ); }
+ void ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine );
+
+ // Wenn wir eine Ftn sind, die auf ihre Referenz zu waechst...
+ // public weil von SwCntntFrm::MakeAll benoetigt.
+ SwTwips GetFtnLine( const SwTxtFtn *pFtn, sal_Bool bLocked ) const;
+
+ // Liefern den linken und den rechten Rand in
+ // Dokumentkoordinaten (unter Beachtung der Absatzattribute).
+ inline SwTwips GetLeftMargin() const;
+ inline SwTwips GetRightMargin() const;
+
+ virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void CheckDirection( BOOL bVert );
+
+ // Liefert die Summe der Zeilenhoehen in pLine zurueck.
+ USHORT GetParHeight() const;
+
+ // Liefert die Resthoehe zurueck
+ inline SwTwips GetRstHeight() const;
+
+ inline SwTxtFrm *GetFollow();
+ inline const SwTxtFrm *GetFollow() const;
+ inline SwTxtFrm *FindMaster();
+ inline const SwTxtFrm *FindMaster() const;
+
+ // Suche die Seitennummer von ErgoSum und QuoVadis
+ SwTxtFrm *FindQuoVadisFrm();
+
+ // holt die Formatierug nach, wenn der Idle-Handler zugeschlagen hat.
+ SwTxtFrm *GetFormatted();
+
+ // wird demnaechst uebertragen
+ inline void SetFtn( const sal_Bool bNew ) { bFtn = bNew; }
+
+ // Beruecksichtigung der Follows
+ inline sal_Bool IsInside( const xub_StrLen nPos ) const;
+
+ const SwBodyFrm *FindBodyFrm() const;
+
+ // DropCaps und Selektionen
+
+ static SwCache *GetTxtCache() { return pTxtCache; }
+ static void SetTxtCache( SwCache *pNew ) { pTxtCache = pNew; }
+
+ static long GetMinPrtLine() { return nMinPrtLine; }
+ static void SetMinPrtLine( long nNew ) { nMinPrtLine = nNew; }
+
+ inline USHORT GetCacheIdx() const { return nCacheIdx; }
+ inline void SetCacheIdx( const USHORT nNew ) { nCacheIdx = nNew; }
+
+ //Entfert die Line-Informationen aus dem Cache.
+ void ClearPara();
+
+ // Bin ich ein FtnFrm, der eine Nummer am Absatzanfang hat?
+ inline sal_Bool IsFtnNumFrm() const
+ { return IsInFtn() && !GetIndPrev() && _IsFtnNumFrm(); }
+
+ // simuliert eine Formatierung, als wenn es keinen rechten Rand und
+ // keine Flys oder andere Hindernisse gaebe und liefert die Breite.
+
+ // liefert den zusaetzlichen Zeilenabstand fuer den naechsten Absatz
+ USHORT GetLineSpace() const;
+
+ // liefert die erste Zeilenhoehe zurueck
+ USHORT FirstLineHeight() const;
+
+ const SwFrmFmt* IsFirstBullet();
+
+ // Haengt FlyInCntFrm um, wenn nEnd > Index >= nStart ist.
+ void MoveFlyInCnt( SwTxtFrm *pNew, USHORT nStart, USHORT nEnd );
+
+ // Berechnet die Position von FlyInCntFrms
+ USHORT CalcFlyPos( SwFrmFmt* pSearch );
+
+ // Ermittelt die Startposition und Schrittweite des Registers
+ sal_Bool FillRegister( SwTwips& rRegStart, USHORT& rRegDiff );
+
+
+
+ //Fuer die Anzeige der Zeilennummern.
+ ULONG GetAllLines() const { return nAllLines; }
+ ULONG GetThisLines() const { return nThisLines;}
+ void RecalcAllLines();
+
+ // Stoppt Animationen innerhalb von Numerierungen
+
+
+ // visit all portions for Accessibility
+
+ // returns the script info stored at the paraportion
+ const SwScriptInfo* GetScriptInfo() const;
+
+ // Swaps width and height of the text frame
+ void SwapWidthAndHeight();
+ // Calculates the coordinates of a rectangle when switching from
+ // horizontal to vertical layout.
+ void SwitchHorizontalToVertical( SwRect& rRect ) const{DBG_BF_ASSERT(0, "STRIP");} ;//STRIP001 void SwitchHorizontalToVertical( SwRect& rRect ) const;
+ // Calculates the coordinates of a point when switching from
+ // horizontal to vertical layout.
+ void SwitchHorizontalToVertical( Point& rPoint ) const{DBG_BF_ASSERT(0, "STRIP");} ;//STRIP001 void SwitchHorizontalToVertical( Point& rPoint ) const;
+ // Calculates the a limit value when switching from
+ // horizontal to vertical layout.
+ long SwitchHorizontalToVertical( long nLimit ) const;
+ // Calculates the coordinates of a rectangle when switching from
+ // vertical to horizontal layout.
+ void SwitchVerticalToHorizontal( SwRect& rRect ) const;
+ // Calculates the coordinates of a point when switching from
+ // vertical to horizontal layout.
+ void SwitchVerticalToHorizontal( Point& rPoint ) const;
+
+#ifdef BIDI
+ // Calculates the coordinates of a point when switching from
+ // LTR to RTL layout.
+ void SwitchLTRtoRTL( Point& rPoint ) const;
+ // Calculates the coordinates of a point when switching from
+ // RTL to LTR layout.
+ inline void SwitchRTLtoLTR( Point& rPoint ) const { SwitchLTRtoRTL( rPoint ); };
+
+#endif
+
+ // OD 14.03.2003 #i11760# - access to new member <mbNoFollowFormat>
+ inline bool FollowFormatAllowed() const
+ {
+ return mbFollowFormatAllowed;
+ }
+ inline void AllowFollowFormat()
+ {
+ mbFollowFormatAllowed = true;
+ }
+ inline void ForbidFollowFormat()
+ {
+ mbFollowFormatAllowed = false;
+ }
+
+ SwTwips GetBaseOfstForFly( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
+ {
+ return ( bIgnoreFlysAnchoredAtThisFrame ?
+ mnFlyAnchorOfst :
+ mnFlyAnchorOfstNoWrap );
+ }
+};
+
+/*************************************************************************
+ * class SwTxtFrmLocker
+ *************************************************************************/
+
+class SwTxtFrmLocker
+{
+private:
+ SwTxtFrm * const pFrm;
+public:
+ inline SwTxtFrmLocker( SwTxtFrm *pTxtFrm )
+ : pFrm( pTxtFrm->IsLocked() ? 0 : pTxtFrm )
+ { if( pFrm ) pFrm->Lock(); }
+ inline ~SwTxtFrmLocker() { if( pFrm ) pFrm->Unlock(); }
+};
+
+/*************************************************************************
+ * Inline-Implementierung
+ *************************************************************************/
+
+inline const SwParaPortion *SwTxtFrm::GetPara() const
+{
+ return ((SwTxtFrm*)this)->GetPara();
+}
+
+inline sal_Bool SwTxtFrm::HasPara() const
+{
+ return nCacheIdx != USHRT_MAX ? _HasPara() : sal_False;
+}
+
+// 9104: Frm().Height() - Prt().Height(), siehe widorp.cxx und 7455, 6114, 7908
+inline SwTwips SwTxtFrm::GetRstHeight() const
+{
+ return !GetUpper() ? 0 : ((const SwFrm*)GetUpper())->Frm().Top()
+ + ((const SwFrm*)GetUpper())->Prt().Top()
+ + ((const SwFrm*)GetUpper())->Prt().Height()
+ - Frm().Top() - (Frm().Height() - Prt().Height());
+}
+
+inline SwTwips SwTxtFrm::GetLeftMargin() const
+{
+ return Frm().Left() + Prt().Left();
+}
+inline SwTwips SwTxtFrm::GetRightMargin() const
+{
+ return Frm().Left() + Prt().Left() + Prt().Width();
+}
+inline SwTwips SwTxtFrm::GrowTst( const SwTwips nGrow )
+{
+ return Grow( nGrow, sal_True );
+}
+
+#if OSL_DEBUG_LEVEL > 1
+// fragt auf WYSIWYG DBG ab
+extern sal_Bool IsDbg( const SwTxtFrm *pFrm );
+#define DBTXTFRM aDbstream << "SwTxtFrm[" << GetFrmId() << "]"
+#endif
+
+inline sal_Bool SwTxtFrm::IsInside( const xub_StrLen nPos ) const
+{
+ sal_Bool bRet = sal_True;
+ if( nPos < GetOfst() )
+ bRet = sal_False;
+ else
+ {
+ const SwTxtFrm *pFoll = GetFollow();
+ if( pFoll && nPos >= pFoll->GetOfst() )
+ bRet = sal_False;
+ }
+ return bRet;
+}
+
+inline SwTwips SwTxtFrm::GetFtnFrmHeight() const
+{
+ if( !IsFollow() && IsInFtn() && HasPara() )
+ return _GetFtnFrmHeight();
+ else
+ return 0;
+}
+
+inline SwTxtFrm *SwTxtFrm::FindMaster()
+{
+ return (SwTxtFrm*)SwFlowFrm::FindMaster();
+}
+inline const SwTxtFrm *SwTxtFrm::FindMaster() const
+{
+ return (const SwTxtFrm*)SwFlowFrm::FindMaster();
+}
+inline const SwTxtFrm *SwTxtFrm::GetFollow() const
+{
+ return (const SwTxtFrm*)SwCntntFrm::GetFollow();
+}
+inline SwTxtFrm *SwTxtFrm::GetFollow()
+{
+ return (SwTxtFrm*)SwCntntFrm::GetFollow();
+}
+
+inline const SwTxtFrm *SwTxtFrm::GetFrmAtPos( const SwPosition &rPos) const
+{
+ return ((SwTxtFrm*)this)->GetFrmAtPos( rPos );
+}
+
+inline void SwTxtFrm::AdjustFollow( SwTxtFormatter &rLine,
+ const xub_StrLen nOffset, const xub_StrLen nStrEnd, const sal_uInt8 nMode )
+{
+ if ( HasFollow() )
+ _AdjustFollow( rLine, nOffset, nStrEnd, nMode );
+}
+
+inline void SwTxtFrm::SetOfst( const xub_StrLen nNewOfst )
+{
+ if ( nOfst != nNewOfst )
+ _SetOfst( nNewOfst );
+}
+
+inline void SwTxtFrm::SetRepaint() const
+{
+ ((SwTxtFrm*)this)->bRepaint = sal_True;
+}
+inline void SwTxtFrm::ResetRepaint() const
+{
+ ((SwTxtFrm*)this)->bRepaint = sal_False;
+}
+
+inline void SwTxtFrm::SetBlinkPor() const
+{
+ ((SwTxtFrm*)this)->bBlinkPor = sal_True;
+}
+inline void SwTxtFrm::ResetBlinkPor() const
+{
+ ((SwTxtFrm*)this)->bBlinkPor = sal_False;
+}
+
+#ifdef LINGU_STATISTIK
+
+class SwLinguStatistik
+{
+public:
+ long nWords; // gepruefte Worte
+ long nFlushCnt; // zaehlt die Messungen
+
+ long nWrong; // als falsch erkannt
+ long nAlter; // Alternativvorschlaege
+ long nSpellTime; // Zeitmessung
+ long nSynonym; // Thesaurus
+ long nNoSynonym; // Thesaurus ratlos
+ long nMeaning; // Thesaurus-Bedeutung
+ long nNoMeaning; // Thesaurus meinungslos
+ long nTheTime; // Zeitmessung
+ long nHyphens; // Trennstellen
+ long nNoHyph; // Worte ohne Trennstellen
+ long nHyphErr; // Fehler beim Trennen
+ long nHyphTime; // Zeitmessung
+ SpellCheck *pSpell;
+ LanguageType eLang;
+
+ void Flush();
+
+ inline SwLinguStatistik()
+ { nWords = nWrong = nAlter = nSynonym = nNoSynonym =
+ nHyphens = nNoHyph = nHyphErr = nSpellTime = nTheTime =
+ nHyphTime = nFlushCnt = 0;
+ pSpell = NULL;
+ eLang = LANGUAGE_DONTKNOW; }
+ inline ~SwLinguStatistik(){ Flush(); }
+};
+
+// globale Variable, implementiert in txtfrm.cxx
+extern SwLinguStatistik aSwLinguStat;
+
+#define SW_LING(nWhich,nInc) (aSwLinguStat.nWhich) += nInc;
+
+#endif
+
+#define SWAP_IF_SWAPPED( pFrm )\
+ sal_Bool bUndoSwap = sal_False; \
+ if ( pFrm->IsVertical() && pFrm->IsSwapped() )\
+ { \
+ bUndoSwap = sal_True; \
+ ((SwTxtFrm*)pFrm)->SwapWidthAndHeight(); \
+ }
+
+#define SWAP_IF_NOT_SWAPPED( pFrm )\
+ sal_Bool bUndoSwap = sal_False; \
+ if ( pFrm->IsVertical() && ! pFrm->IsSwapped() )\
+ { \
+ bUndoSwap = sal_True; \
+ ((SwTxtFrm*)pFrm)->SwapWidthAndHeight(); \
+ }
+
+#define UNDO_SWAP( pFrm )\
+ if ( bUndoSwap )\
+ ((SwTxtFrm*)pFrm)->SwapWidthAndHeight();
+
+// Helper class which can be used instead of the macros if a function
+// has too many returns
+class SwFrmSwapper
+{
+ const SwTxtFrm* pFrm;
+ sal_Bool bUndo;
+public:
+ SwFrmSwapper( const SwTxtFrm* pFrm, sal_Bool bSwapIfNotSwapped );
+ ~SwFrmSwapper();
+};
+
+#ifdef BIDI
+
+class SwLayoutModeModifier
+{
+ const OutputDevice& rOut;
+ long nOldLayoutMode;
+public:
+ SwLayoutModeModifier( const OutputDevice& rOutp );
+ ~SwLayoutModeModifier();
+ void SetAuto();
+};
+
+#endif
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/txttypes.hxx b/binfilter/bf_sw/source/core/inc/txttypes.hxx
new file mode 100644
index 000000000000..842c087e9f6b
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/txttypes.hxx
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TXTTYPES_HXX
+#define _TXTTYPES_HXX
+
+namespace binfilter {
+
+// Ueberpruefte USHORTs, z.B. Indizes auf Arrays oder garantiert kleine
+// Integerwerte, auch von aussen vorgegebene
+#define MSHORT USHORT
+#define MSHRT_MAX USHRT_MAX
+// Koordinaten: Breite, Hoehe und Offsets in X-/Y-Richtung sowie Ascent etc.
+#define KSHORT USHORT
+#define KSHRT_MAX USHRT_MAX
+
+// Portiontypen
+#define POR_LIN 0x0000
+#define POR_FLYCNT 0x0001
+
+#define POR_HOLE 0x0080
+#define POR_TMPEND 0x0081
+#define POR_BRK 0x0082
+#define POR_KERN 0x0083
+#define POR_ARROW 0x0084
+#define POR_MULTI 0x0085
+
+#define POR_TXT 0x8000
+#define POR_LAY 0x8001
+#define POR_PARA 0x8002
+#define POR_URL 0x8003
+#define POR_HNG 0x8004
+
+#define POR_DROP 0x8080
+#define POR_TOX 0x8089
+#define POR_ISOTOX 0x808a
+#define POR_REF 0x808b
+#define POR_ISOREF 0x808c
+
+#define POR_EXP 0xc080
+#define POR_BLANK 0xc081
+#define POR_POSTITS 0xc082
+
+#define POR_HYPH 0xd080
+#define POR_HYPHSTR 0xd081
+#define POR_SOFTHYPH 0xd082
+#define POR_SOFTHYPHSTR 0xd083
+#define POR_SOFTHYPH_COMP 0xd084
+
+#define POR_FLD 0xe080
+#define POR_HIDDEN 0xe081
+#define POR_QUOVADIS 0xe082
+#define POR_ERGOSUM 0xe083
+#define POR_COMBINED 0xe084
+#define POR_FTN 0xe085
+
+#define POR_FTNNUM 0xe880
+#define POR_NUMBER 0xe881
+#define POR_BULLET 0xe882
+#define POR_GRFNUM 0xe883
+
+#define POR_GLUE 0x0480
+
+#define POR_MARGIN 0x04c0
+
+#define POR_FIX 0x06c0
+#define POR_FLY 0x06c1
+
+#define POR_TAB 0x0750
+
+#define POR_TABRIGHT 0x07d0
+#define POR_TABCENTER 0x07d1
+#define POR_TABDECIMAL 0x07d2
+
+#define POR_TABLEFT 0x0740
+
+} //namespace binfilter
+#endif //_TXTTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/unoclbck.hxx b/binfilter/bf_sw/source/core/inc/unoclbck.hxx
new file mode 100644
index 000000000000..597cae3a6834
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/unoclbck.hxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _UNOCLBCK_HXX
+#define _UNOCLBCK_HXX
+
+
+#include <calbck.hxx>
+namespace binfilter {
+
+class SwXReferenceMark;
+class SwFmtRefMark;
+class SwFmtFtn;
+class SwXFootnote;
+class SwTOXMark;
+class SwXDocumentIndexMark;
+
+class SwUnoCallBack : public SwModify
+{
+public:
+ SwUnoCallBack(SwModify *pToRegisterIn);
+ virtual ~SwUnoCallBack();
+
+ // returns the API object of a reference mark if available
+ SwXReferenceMark* GetRefMark(const SwFmtRefMark& rMark);
+ SwXFootnote* GetFootnote(const SwFmtFtn& rMark);
+ SwXDocumentIndexMark* GetTOXMark(const SwTOXMark& rMark);
+};
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/unofldmid.h b/binfilter/bf_sw/source/core/inc/unofldmid.h
new file mode 100644
index 000000000000..f74d999844f9
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/unofldmid.h
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SW_UNOFLDMID_H
+#define SW_UNOFLDMID_H
+
+class String;
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+//Abbildung der Properties auf den Descriptor
+#define FIELD_PROP_PAR1 10
+#define FIELD_PROP_PAR2 11
+#define FIELD_PROP_PAR3 12
+#define FIELD_PROP_FORMAT 13
+#define FIELD_PROP_SUBTYPE 14
+#define FIELD_PROP_BOOL1 15
+#define FIELD_PROP_BOOL2 16
+#define FIELD_PROP_DATE 17
+#define FIELD_PROP_USHORT1 18
+#define FIELD_PROP_USHORT2 19
+#define FIELD_PROP_BYTE1 20
+#define FIELD_PROP_DOUBLE 21
+#define FIELD_PROP_BOOL3 22
+#define FIELD_PROP_PAR4 23
+#define FIELD_PROP_SHORT1 24
+#define FIELD_PROP_DATE_TIME 25
+#define FIELD_PROP_PROP_SEQ 26
+#define FIELD_PROP_LOCALE 27
+#define FIELD_PROP_BOOL4 28
+#define FIELD_PROP_STRINGS 29
+
+String& GetString( const com::sun::star::uno::Any&, String& rStr );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/viewimp.hxx b/binfilter/bf_sw/source/core/inc/viewimp.hxx
new file mode 100644
index 000000000000..a7e8c4e23e43
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/viewimp.hxx
@@ -0,0 +1,327 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _VIEWIMP_HXX
+#define _VIEWIMP_HXX
+
+
+#include <vcl/timer.hxx>
+#include <tools/color.hxx>
+// OD 25.06.2003 #108784#
+#include <bf_svx/svdtypes.hxx>
+
+#include "swtypes.hxx"
+#include "swrect.hxx"
+#include <tools/debug.hxx> //for strip
+#ifdef ACCESSIBLE_LAYOUT
+class Fraction;
+#endif
+namespace binfilter {
+class ViewShell;
+class SwFlyFrm;
+class SwViewOption;
+class SwRegionRects;
+class SwScrollAreas;
+class SwScrollColumn;
+class SwFrm;
+class SwLayAction;
+class SwLayIdle;
+class SwDrawView;
+class SdrPageView;
+class SwPageFrm;
+class SwRegionRects;
+class ExtOutputDevice;
+class SdrPaintInfoRec;
+struct SdrPaintProcRec;
+#ifdef ACCESSIBLE_LAYOUT
+class SwAccessibleMap;
+class SdrObject;
+//STRIP008 class Fraction;
+#endif
+// OD 12.12.2002 #103492#
+class SwPagePreviewLayout;
+// OD 15.01.2003 #103492#
+} //namespace binfilter
+
+#include <prevwpage.hxx>
+// OD 15.01.2003 #103492#
+#include <vector>
+namespace binfilter {//STRIP009
+class SwViewImp
+{
+ friend class ViewShell;
+
+ friend class SwLayAction; //Lay- und IdleAction tragen sich ein und aus.
+ friend class SwLayIdle;
+
+ // OD 12.12.2002 #103492# - for paint of page preview
+ friend class SwPagePreviewLayout;
+
+ ViewShell *pSh; //Falls jemand einen Imp durchreicht und doch
+ //mal eine ViewShell braucht hier die
+ //Rueckwaertsverkettung.
+
+ SwDrawView *pDrawView; //Unsere DrawView
+ SdrPageView *pSdrPageView; //Genau eine Seite fuer unsere DrawView
+
+ SwPageFrm *pFirstVisPage;//Zeigt immer auf die erste sichtbare Seite.
+ SwRegionRects *pRegion; //Sammler fuer Paintrects aus der LayAction.
+ SwScrollAreas *pScrollRects; //Sammler fuer Scrollrects aus der LayAction.
+ SwScrollAreas *pScrolledArea;//Sammler der gescrollten Rechtecke.
+
+ SwLayAction *pLayAct; //Ist gesetzt wenn ein Action-Objekt existiert
+ //Wird vom SwLayAction-CTor ein- und vom DTor
+ //ausgetragen.
+ SwLayIdle *pIdleAct; //Analog zur SwLayAction fuer SwLayIdle.
+
+#ifdef ACCESSIBLE_LAYOUT
+#endif
+
+
+ AutoTimer aScrollTimer; //Fuer das Aufraeumen nach dem Scrollen.
+
+ BOOL bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
+ BOOL bNextScroll :1; //Scroll in der folgenden EndAction erlaubt?
+ BOOL bScroll :1; //Scroll in der aktuellen EndAction erlaubt?
+ BOOL bScrolled :1; //Wurde gescrolled? Dann im Idle aufraeumen.
+
+ BOOL bResetXorVisibility:1; //StartAction/EndAction
+ BOOL bShowHdlPaint :1; //LockPaint/UnlockPaint
+ BOOL bResetHdlHiddenPaint:1;// -- "" --
+ BOOL bPaintInScroll :1; //Paint (Update() im ScrollHdl der ViewShell
+
+ BOOL bSmoothUpdate :1; //Meber fuer SmoothScroll
+ BOOL bStopSmooth :1;
+ BOOL bStopPrt :1; // Stop Printing
+
+ USHORT nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO)
+ SwRect aSmoothRect;
+
+ // OD 12.12.2002 #103492#
+
+ /**
+ Signal whether to stop printing.
+
+ @param _useless just to fit macro
+ */
+ DECL_LINK(SetStopPrt, void * _useless = NULL);
+
+ /**
+ Returns if printer shall be stopped.
+
+ @retval TRUE The printer shall be stopped.
+ @retval FALSE else
+ */
+ BOOL IsStopPrt() { return bStopPrt; }
+
+ /**
+ Resets signal for stopping printing.
+
+ */
+ void ResetStopPrt() { bStopPrt = FALSE; }
+
+ void SetFirstVisPage(); //Neue Ermittlung der ersten sichtbaren Seite
+
+ void ResetNextScroll() { bNextScroll = FALSE; }
+ void SetNextScroll() { bNextScroll = TRUE; }
+ void SetScroll() { bScroll = TRUE; }
+ void ResetScrolled() { bScrolled = FALSE; }
+ void SetScrolled() { bScrolled = TRUE; }
+
+ SwScrollAreas *GetScrollRects() { return pScrollRects; }
+
+ void StartAction(); //Henkel Anzeigen und verstecken.
+ void EndAction(); //gerufen von ViewShell::ImplXXXAction
+
+#ifdef ACCESSIBLE_LAYOUT
+#endif
+
+public:
+ ~SwViewImp();
+ void Init( const SwViewOption * ); //nur fuer ViewShell::Init()
+
+ const ViewShell *GetShell() const { return pSh; }
+ ViewShell *GetShell() { return pSh; }
+
+
+ //Verwaltung zur ersten sichtbaren Seite
+ inline const SwPageFrm *GetFirstVisPage() const;
+ inline SwPageFrm *GetFirstVisPage();
+ void SetFirstVisPageInvalid() { bFirstPageInvalid = TRUE; }
+
+ //SS'en fuer Paint- und Scrollrects.
+ BOOL AddPaintRect( const SwRect &rRect );
+ void AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, long nOffs );
+ SwRegionRects *GetRegion() { return pRegion; }
+ void DelRegions(); //Loescht Scroll- und PaintRects
+
+ //Handler fuer das Refresh von gescrollten Bereichen (Korrektur des
+ //Alignments). Ruft das Refresh mit der ScrolledArea.
+ //RefreshScrolledArea kann z.B. beim Setzen des Crsr genutzt werden, es
+ //wird nur der Anteil des Rect refreshed, der mit der ScrolledArea
+ //ueberlappt. Das 'reingereichte Rechteck wird veraendert!
+ void RestartScrollTimer() { aScrollTimer.Start(); }
+ DECL_LINK( RefreshScrolledHdl, Timer * );
+
+ //Wird vom Layout ggf. waehrend einer Action gerufen, wenn der
+ //Verdacht besteht, dass es etwas drunter und drueber geht.
+ void ResetScroll() { bScroll = FALSE; }
+
+ BOOL IsNextScroll() const { return bNextScroll; }
+ BOOL IsScroll() const { return bScroll; }
+ BOOL IsScrolled() const { return bScrolled; }
+
+ BOOL IsPaintInScroll() const { return bPaintInScroll; }
+
+ // neues Interface fuer StarView Drawing
+ inline BOOL HasDrawView() const { return 0 != pDrawView; }
+ SwDrawView* GetDrawView() { return pDrawView; }
+ const SwDrawView* GetDrawView() const { return pDrawView; }
+ SdrPageView*GetPageView() { return pSdrPageView; }
+ const SdrPageView*GetPageView() const { return pSdrPageView; }
+ void MakeDrawView();
+
+ // OD 29.08.2002 #102450#
+ // add 3rd parameter <const Color* pPageBackgrdColor> for setting this
+ // color as the background color at the outliner of the draw view
+ // for painting layers <hell> and <heaven>
+ // OD 09.12.2002 #103045# - add 4th parameter for the horizontal text
+ // direction of the page in order to set the default horizontal text
+ // direction at the outliner of the draw view for painting layers <hell>
+ // and <heaven>.
+ // OD 25.06.2003 #108784# - correct type of 1st parameter
+
+ //wird als Link an die DrawEngine uebergeben, entscheidet was wie
+ //gepaintet wird oder nicht.
+
+ // Interface Drawing
+ void NotifySizeChg( const Size &rNewSz );
+
+ //SS Fuer die Lay- bzw. IdleAction und verwandtes
+ BOOL IsAction() const { return pLayAct != 0; }
+ BOOL IsIdleAction() const { return pIdleAct != 0; }
+ SwLayAction &GetLayAction() { return *pLayAct; }
+ const SwLayAction &GetLayAction() const { return *pLayAct; }
+ SwLayIdle &GetIdleAction() { return *pIdleAct;}
+ const SwLayIdle &GetIdleAction() const { return *pIdleAct;}
+
+ //Wenn eine Aktion laueft wird diese gebeten zu pruefen ob es
+ //an der zeit ist den WaitCrsr einzuschalten.
+ void CheckWaitCrsr();
+ BOOL IsCalcLayoutProgress() const; //Fragt die LayAction wenn vorhanden.
+ //TRUE wenn eine LayAction laeuft, dort wird dann auch das Flag fuer
+ //ExpressionFields gesetzt.
+ BOOL IsUpdateExpFlds();
+
+ void SetRestoreActions(USHORT nSet){nRestoreActions = nSet;}
+ USHORT GetRestoreActions() const{return nRestoreActions;}
+
+ // OD 12.12.2002 #103492#
+
+ // OD 12.12.2002 #103492#
+
+#ifdef ACCESSIBLE_LAYOUT
+ // Is this view accessible?
+
+
+ // Update (this) accessible view
+
+ // Remove a frame from the accessible view
+ void DisposeAccessible( const SwFrm *pFrm, const SdrObject *pObj,
+ sal_Bool bRecursive );
+ inline void DisposeAccessibleObj( const SdrObject *pObj );
+
+ // Move a frame's position in the accessible view
+ void MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
+ const SwRect& rOldFrm );
+
+ // Add a frame in the accessible view
+
+ inline void AddAccessibleObj( const SdrObject *pObj );
+
+ // Invalidate accessible frame's frame's content
+ void InvalidateAccessibleFrmContent( const SwFrm *pFrm );
+
+ // Invalidate accessible frame's cursor position
+
+ // Invalidate editable state for all accessible frames
+
+ // Invalidate opaque state for all accessible frames
+
+ // Invalidate frame's relation set (for chained frames)
+
+ // update data for accessible preview
+ // OD 15.01.2003 #103492# - change method signature due to new page preview
+ // functionality
+
+
+ // Fire all accessible events that have been collected so far
+#endif
+};
+
+//Kann auf dem Stack angelegt werden, wenn etwas ausgegeben oder
+//gescrolled wird. Handles und sontiges vom Drawing werden im CTor
+//gehidet und im DTor wieder sichtbar gemacht.
+//AW 06-Sep99: Hiding of handles is no longer necessary, removed
+
+
+inline SwPageFrm *SwViewImp::GetFirstVisPage()
+{
+ if ( bFirstPageInvalid )
+ SetFirstVisPage();
+ return pFirstVisPage;
+}
+
+inline const SwPageFrm *SwViewImp::GetFirstVisPage() const
+{
+ if ( bFirstPageInvalid )
+ ((SwViewImp*)this)->SetFirstVisPage();
+ return pFirstVisPage;
+}
+
+#ifdef ACCESSIBLE_LAYOUT
+
+
+inline void SwViewImp::DisposeAccessibleObj( const SdrObject *pObj )
+{
+ DisposeAccessible( 0, pObj, sal_False );
+}
+
+
+
+inline void SwViewImp::AddAccessibleObj( const SdrObject *pObj )
+{
+ SwRect aEmptyRect;
+ MoveAccessible( 0, pObj, aEmptyRect );
+}
+
+#endif
+
+} //namespace binfilter
+#endif //_VIEWIMP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/visiturl.hxx b/binfilter/bf_sw/source/core/inc/visiturl.hxx
new file mode 100644
index 000000000000..ff0b4ab90e5f
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/visiturl.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _VISITURL_HXX
+#define _VISITURL_HXX
+
+
+
+
+#include <bf_svtools/lstner.hxx>
+namespace binfilter {
+class SwDoc;
+
+class SwURLStateChanged : public SfxListener
+{
+ const SwDoc* pDoc;
+public:
+ SwURLStateChanged( const SwDoc* pD );
+ virtual ~SwURLStateChanged();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+};
+
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_sw/source/core/inc/wrong.hxx b/binfilter/bf_sw/source/core/inc/wrong.hxx
new file mode 100644
index 000000000000..0cddd5f2a386
--- /dev/null
+++ b/binfilter/bf_sw/source/core/inc/wrong.hxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _WRONG_HXX
+#define _WRONG_HXX
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_XUB_STRLEN
+#define _SVSTDARR_ULONGS
+#include <bf_svtools/svstdarr.hxx>
+#endif
+/*N*/ #include <tools/debug.hxx> //for stripping
+namespace binfilter {
+#define WRPOS( nIdx ) ((xub_StrLen)( GetObject( nIdx ) ))
+#define WRLEN( nIdx ) ((xub_StrLen)( aLen.GetObject( nIdx ) ))
+
+class SwWrongList : public SvXub_StrLens
+{
+ SvXub_StrLens aLen;
+ xub_StrLen nBeginInvalid; // Start des ungueltigen Bereichs
+ xub_StrLen nEndInvalid; // Ende des ungueltigen Bereichs
+ void ShiftLeft( xub_StrLen &rPos, xub_StrLen nStart, xub_StrLen nEnd )
+ { if( rPos > nStart ) rPos = rPos > nEnd ? rPos - nEnd + nStart : nStart; }
+ void ShiftRight( xub_StrLen &rPos, xub_StrLen nStart, xub_StrLen nEnd )
+ { if( rPos >= nStart ) rPos += nStart - nEnd; }
+ void _Invalidate( xub_StrLen nBegin, xub_StrLen nEnd );
+public:
+ inline SwWrongList() :
+ SvXub_StrLens(5,5), aLen(5,5), nBeginInvalid( STRING_LEN ){}
+ inline xub_StrLen GetBeginInv() const { return nBeginInvalid; }
+ inline xub_StrLen GetEndInv() const { return nEndInvalid; }
+ inline BOOL InsideInvalid( xub_StrLen nChk ) const
+ { return nChk >= nBeginInvalid && nChk <= nEndInvalid; }
+ inline void SetInvalid( xub_StrLen nBegin, xub_StrLen nEnd )
+ { nBeginInvalid = nBegin; nEndInvalid = nEnd; }
+ inline void Validate(){ nBeginInvalid = STRING_LEN; }
+ inline void Invalidate( xub_StrLen nBegin, xub_StrLen nEnd )
+ { if( STRING_LEN == GetBeginInv() ) SetInvalid( nBegin, nEnd );
+ else _Invalidate( nBegin, nEnd ); }
+ BOOL InvalidateWrong();
+ void Move( xub_StrLen nPos, long nDiff ){DBG_BF_ASSERT(0, "STRIP");} ;//STRIP001 void Move( xub_StrLen nPos, long nDiff );
+
+ // Divide the list into two part, the wrong words until nSplitPos will be
+ // removed and transferred to a new SwWrongList.
+ // Join the next SwWrongList, nInsertPos is my own text length, where
+ // the other wrong list has to be inserted.
+
+ inline xub_StrLen Len( USHORT nIdx ) const { return WRLEN( nIdx ); }
+ inline xub_StrLen Pos( USHORT nIdx ) const { return WRPOS( nIdx ); }
+ inline void Insert( xub_StrLen nNewPos, xub_StrLen nNewLen, USHORT nWhere )
+ {SvXub_StrLens::Insert( nNewPos, nWhere ); aLen.Insert( nNewLen, nWhere );}
+
+// Wer braucht dies?
+ void Insert( ULONG nNew )
+ ;// { SvULongs::Insert( nNew, GetPos( (USHORT)( nNew & WRMASK ) ) ); }
+};
+
+
+} //namespace binfilter
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */