[Libreoffice-commits] .: binfilter/bf_svx binfilter/inc
Joseph Powers
jpowers at kemper.freedesktop.org
Sat Oct 22 05:09:44 PDT 2011
binfilter/bf_svx/source/editeng/impedit.hxx | 80 -----------------------
binfilter/bf_svx/source/editeng/svx_impedit2.cxx | 59 +---------------
binfilter/bf_svx/source/editeng/svx_impedit3.cxx | 45 ------------
binfilter/inc/bf_svx/editdata.hxx | 6 -
4 files changed, 7 insertions(+), 183 deletions(-)
New commits:
commit a8230c23ef7021d153a5281e3e071934a8b5042d
Author: Joseph Powers <jpowers27 at cox.net>
Date: Sat Oct 22 05:05:59 2011 -0700
Cleanup class ImpEditEngine a little
diff --git a/binfilter/bf_svx/source/editeng/impedit.hxx b/binfilter/bf_svx/source/editeng/impedit.hxx
index 16525d0..01685b5 100644
--- a/binfilter/bf_svx/source/editeng/impedit.hxx
+++ b/binfilter/bf_svx/source/editeng/impedit.hxx
@@ -101,17 +101,6 @@ namespace clipboard {
namespace binfilter {
-struct ImplIMEInfos
-{
- String aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
- EditPaM aPos;
- sal_uInt16 nLen;
- sal_Bool bCursor;
- sal_Bool bWasCursorOverwrite;
-};
-
-
struct FormatterFontMetric
{
sal_uInt16 nMaxAscent;
@@ -138,40 +127,16 @@ private:
Window* pOutWin;
Pointer* pPointer;
- long nInvMore;
ULONG nControl;
- sal_uInt32 nTravelXPos;
- sal_uInt16 nExtraCursorFlags;
- sal_uInt16 nCursorBidiLevel;
- sal_uInt16 nScrollDiffX;
sal_Bool bReadOnly;
- sal_Bool bClickedInSelection;
- sal_Bool bActiveDragAndDropListener;
- Point aAnchorPoint;
Rectangle aOutArea;
Point aVisDocStartPos;
- EESelectionMode eSelectionMode;
EditSelection aEditSelection;
- EVAnchorMode eAnchorMode;
-
-protected:
-
- // DragAndDropClient
-
-
public:
~ImpEditView();
- EditView* GetEditViewPtr() { return pEditView; }
-
- sal_uInt16 GetScrollDiffX() const { return nScrollDiffX; }
- void SetScrollDiffX( sal_uInt16 n ) { nScrollDiffX = n; }
-
- sal_uInt16 GetCursorBidiLevel() const { return nCursorBidiLevel; }
- void SetCursorBidiLevel( sal_uInt16 n ) { nCursorBidiLevel = n; }
-
Point GetDocPos( const Point& rWindowPos ) const;
Point GetWindowPos( const Point& rDocPos ) const;
Rectangle GetWindowPos( const Rectangle& rDocPos ) const;
@@ -180,9 +145,6 @@ public:
BOOL IsVertical() const;
- void SetVisDocStartPos( const Point& rPos ) { aVisDocStartPos = rPos; }
- const Point& GetVisDocStartPos() const { return aVisDocStartPos; }
-
long GetVisDocLeft() const { return aVisDocStartPos.X(); }
long GetVisDocTop() const { return aVisDocStartPos.Y(); }
long GetVisDocRight() const { return aVisDocStartPos.X() + ( !IsVertical() ? aOutArea.GetWidth() : aOutArea.GetHeight() ); }
@@ -198,36 +160,19 @@ public:
Window* GetWindow() const { return pOutWin; }
- EESelectionMode GetSelectionMode() const { return eSelectionMode; }
-
inline void SetPointer( const Pointer& rPointer );
- inline const Pointer& GetPointer();
+ inline const Pointer& GetPointer();
inline void SetCursor( const Cursor& rCursor );
inline Cursor* GetCursor();
-
- EVAnchorMode GetAnchorMode() const { return eAnchorMode; }
void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, BOOL test );
- sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); }
-
- void EnablePaste( sal_Bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); }
- sal_Bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); }
-
- sal_Bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); }
- sal_Bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); }
- sal_Bool DoBigScroll() const { return ( ( nControl & EV_CNTRL_BIGSCROLL ) != 0 ); }
- sal_Bool DoAutoSize() const { return ( ( nControl & EV_CNTRL_AUTOSIZE ) != 0 ); }
- sal_Bool DoAutoWidth() const { return ( ( nControl & EV_CNTRL_AUTOSIZEX) != 0 ); }
- sal_Bool DoInvalidateMore() const { return ( ( nControl & EV_CNTRL_INVONEMORE ) != 0 ); }
+ sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); }
+ sal_Bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); }
const Color& GetBackgroundColor() const {
return ( pBackgroundColor ? *pBackgroundColor : pOutWin->GetBackground().GetColor() ); }
-
- // Ggf. mehr als OutputArea invalidieren, fuer den DrawingEngine-Textrahmen...
- void SetInvalidateMore( sal_uInt16 nPixel ) { nInvMore = nPixel; }
- sal_uInt16 GetInvalidateMore() const { return (sal_uInt16)nInvMore; }
};
// ----------------------------------------------------------------------
@@ -288,8 +233,6 @@ private:
EditUndoManager* pUndoManager;
ESelection* pUndoMarkSelection;
- ImplIMEInfos* mpIMEInfos;
-
NotifyList aNotifyCache;
XubString aWordDelimiters;
@@ -307,8 +250,6 @@ private:
USHORT nAsianCompressionMode;
BOOL bKernAsianPunctuation;
- EEHorizontalTextDirection eDefaultHorizontalTextDirection;
-
sal_uInt16 nBigTextObjectStart;
::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > xBI;
@@ -410,8 +351,6 @@ private:
void ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT nEnd, SvUShorts& rArray );
-
-
EditPaM WordRight( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, BOOL bAcceptStartOfWord = TRUE );
EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, USHORT nCharacterIteratorMode, BOOL bToLeft );
@@ -424,11 +363,8 @@ private:
BOOL IsScriptChange( const EditPaM& rPaM ) const;
BOOL HasScriptType( USHORT nPara, USHORT nType ) const;
-
void ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USHORT nIndex );
-
-
inline short GetXValue( short nXValue ) const;
inline sal_uInt16 GetXValue( sal_uInt16 nXValue ) const;
inline long GetXValue( long nXValue ) const;
@@ -436,8 +372,6 @@ private:
inline short GetYValue( short nYValue ) const;
inline sal_uInt16 GetYValue( sal_uInt16 nYValue ) const;
-
-
void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; }
Color GetBackgroundColor() const { return maBackgroundColor; }
@@ -458,10 +392,6 @@ private:
::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator();
-
-
-protected:
-
public:
ImpEditEngine( EditEngine* pEditEngine, SfxItemPool* pPool );
~ImpEditEngine();
@@ -485,10 +415,6 @@ public:
void SetVertical( BOOL bVertical );
BOOL IsVertical() const { return GetEditDoc().IsVertical(); }
- void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; }
- EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; }
-
-
void InitWritingDirections( USHORT nPara );
BOOL IsRightToLeft( USHORT nPara ) const;
BYTE GetRightToLeft( USHORT nPara, USHORT nChar, USHORT* pStart = NULL, USHORT* pEnd = NULL );
diff --git a/binfilter/bf_svx/source/editeng/svx_impedit2.cxx b/binfilter/bf_svx/source/editeng/svx_impedit2.cxx
index d57d15c..b04e415 100644
--- a/binfilter/bf_svx/source/editeng/svx_impedit2.cxx
+++ b/binfilter/bf_svx/source/editeng/svx_impedit2.cxx
@@ -99,7 +99,6 @@ using namespace ::com::sun::star;
/*N*/ pEmptyItemSet = NULL;
/*N*/ pActiveView = NULL;
/*N*/ pTextObjectPool = NULL;
-/*N*/ mpIMEInfos = NULL;
/*N*/ pStylePool = NULL;
/*N*/ pUndoManager = NULL;
/*N*/ pUndoMarkSelection = NULL;
@@ -136,9 +135,6 @@ using namespace ::com::sun::star;
/*N*/ nAsianCompressionMode = text::CharacterCompressionType::NONE;
/*N*/ bKernAsianPunctuation = FALSE;
/*N*/
-/*N*/ eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT;
-/*N*/
-/*N*/
/*N*/ aStatus.GetControlWord() = EE_CNTRL_USECHARATTRIBS | EE_CNTRL_DOIDLEFORMAT |
/*N*/ EE_CNTRL_PASTESPECIAL | EE_CNTRL_UNDOATTRIBS |
/*N*/ EE_CNTRL_ALLOWBIGOBJS | EE_CNTRL_RTFSTYLESHEETS |
@@ -168,9 +164,8 @@ using namespace ::com::sun::star;
/*N*/ delete pEmptyItemSet;
/*N*/ delete pUndoManager;
/*N*/ delete pTextRanger;
-/*N*/ delete mpIMEInfos;
-/*N*/ delete pColorConfig;
-/*N*/ delete pCTLOptions;
+/*N*/ delete pColorConfig;
+/*N*/ delete pCTLOptions;
/*N*/ if ( bOwnerOfRefDev )
/*N*/ delete pRefDev;
/*N*/ }
@@ -406,21 +401,6 @@ using namespace ::com::sun::star;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*N*/ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType )
/*N*/ {
/*N*/ xub_StrLen nMax = rPaM.GetNode()->Len();
@@ -740,20 +720,11 @@ using namespace ::com::sun::star;
/*N*/
/*N*/ if ( !IsVertical() )
/*N*/ {
-/*N*/ bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L;
/*N*/ pFrameDirItem = &(const SvxFrameDirectionItem&)GetParaAttrib( nPara, EE_PARA_WRITINGDIR );
/*N*/ if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT )
/*N*/ {
-/*N*/ // #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default.
-/*N*/ if ( GetDefaultHorizontalTextDirection() != EE_HTEXTDIR_DEFAULT )
-/*N*/ {
-/*?*/ pFrameDirItem = NULL; // bR2L allready set to default horizontal text direction
-/*N*/ }
-/*N*/ else
-/*N*/ {
-/*N*/ // Use pool default
-/*N*/ pFrameDirItem = &(const SvxFrameDirectionItem&)((ImpEditEngine*)this)->GetEmptyItemSet().Get( EE_PARA_WRITINGDIR );
-/*N*/ }
+/*N*/ // Use pool default
+/*N*/ pFrameDirItem = &(const SvxFrameDirectionItem&)((ImpEditEngine*)this)->GetEmptyItemSet().Get( EE_PARA_WRITINGDIR );
/*N*/ }
/*N*/ }
/*N*/
@@ -767,7 +738,6 @@ using namespace ::com::sun::star;
/*N*/ BYTE ImpEditEngine::GetRightToLeft( USHORT nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd )
/*N*/ {
-/*N*/ // BYTE nRightToLeft = IsRightToLeft( nPara ) ? 1 : 0;
/*N*/ BYTE nRightToLeft = 0;
/*N*/
/*N*/ ContentNode* pNode = aEditDoc.SaveGetObject( nPara );
@@ -1448,19 +1418,6 @@ using namespace ::com::sun::star;
/*N*/ if ( pActiveView && pActiveView->HasSelection() )
/*?*/ pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen...
/*N*/
-/*N*/ // NN: Quick fix for #78668#:
-/*N*/ // When editing of a cell in Calc is ended, the edit engine is not deleted,
-/*N*/ // only the edit views are removed. If mpIMEInfos is still set in that case,
-/*N*/ // mpIMEInfos->aPos points to an invalid selection.
-/*N*/ // -> reset mpIMEInfos now
-/*N*/ // (probably something like this is necessary whenever the content is modified
-/*N*/ // from the outside)
-/*N*/
-/*N*/ if ( !pView && mpIMEInfos )
-/*N*/ {
-/*?*/ delete mpIMEInfos;
-/*?*/ mpIMEInfos = NULL;
-/*N*/ }
/*N*/ }
@@ -1579,14 +1536,6 @@ using namespace ::com::sun::star;
/*N*/ nCurIndex = GetChar( pPortion, pLine, aDocPos.X(), bSmart );
/*N*/ aPaM.SetIndex( nCurIndex );
/*N*/
-/*N*/ if ( nCurIndex
- && ( nCurIndex == pLine->GetEnd() )
- && ( pLine != pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1) )
- )
-/*N*/ {
-/*?*/ DBG_BF_ASSERT(0, "STRIP");
-/*N*/ }
-/*N*/
/*N*/ return aPaM;
/*N*/ }
diff --git a/binfilter/bf_svx/source/editeng/svx_impedit3.cxx b/binfilter/bf_svx/source/editeng/svx_impedit3.cxx
index a169b2f..f3146a1 100644
--- a/binfilter/bf_svx/source/editeng/svx_impedit3.cxx
+++ b/binfilter/bf_svx/source/editeng/svx_impedit3.cxx
@@ -1737,20 +1737,6 @@ struct TabInfo
/*N*/ for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ )
/*?*/ aPositions.Insert( rWritingDirections[nD].nStartPos );
/*N*/
-/*N*/ if ( mpIMEInfos && mpIMEInfos->nLen && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetNode() == pNode ) )
-/*N*/ {
-/*?*/ sal_uInt16 nLastAttr = 0xFFFF;
-/*?*/ for( sal_uInt16 n = 0; n < mpIMEInfos->nLen; n++ )
-/*?*/ {
-/*?*/ if ( mpIMEInfos->pAttribs[n] != nLastAttr )
-/*?*/ {
-/*?*/ aPositions.Insert( mpIMEInfos->aPos.GetIndex() + n );
-/*?*/ nLastAttr = mpIMEInfos->pAttribs[n];
-/*?*/ }
-/*?*/ }
-/*?*/ aPositions.Insert( mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen );
-/*N*/ }
-/*N*/
/*N*/ // Ab ... loeschen:
/*N*/ // Leider muss die Anzahl der TextPortions mit aPositions.Count()
/*N*/ // nicht uebereinstimmen, da evtl. Zeilenumbrueche...
@@ -2117,37 +2103,6 @@ struct TabInfo
/*?*/ rFont.SetColor( COL_BLACK );
/*N*/ }
/*N*/ }
-/*N*/
-/*N*/ if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetNode() == pNode ) &&
-/*N*/ ( nPos > mpIMEInfos->aPos.GetIndex() ) && ( nPos <= ( mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen ) ) )
-/*N*/ {
-/*?*/ sal_uInt16 nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ];
-/*?*/ if ( nAttr & EXTTEXTINPUT_ATTR_UNDERLINE )
-/*?*/ rFont.SetUnderline( UNDERLINE_SINGLE );
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE )
-/*?*/ rFont.SetUnderline( UNDERLINE_BOLD );
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE )
-/*?*/ rFont.SetUnderline( UNDERLINE_DOTTED );
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE )
-/*?*/ rFont.SetUnderline( UNDERLINE_DOTTED );
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_REDTEXT )
-/*?*/ rFont.SetColor( Color( COL_RED ) );
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_HALFTONETEXT )
-/*?*/ rFont.SetColor( Color( COL_LIGHTGRAY ) );
-/*?*/ if ( nAttr & EXTTEXTINPUT_ATTR_HIGHLIGHT )
-/*?*/ {
-/*?*/ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-/*?*/ rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
-/*?*/ rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
-/*?*/ rFont.SetTransparent( FALSE );
-/*?*/ }
-/*?*/ else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
-/*?*/ {
-/*?*/ rFont.SetUnderline( UNDERLINE_WAVE );
-/*?*/ if( pOut )
-/*?*/ pOut->SetTextLineColor( Color( COL_LIGHTGRAY ) );
-/*?*/ }
-/*N*/ }
/*N*/ }
/*N*/ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont )
diff --git a/binfilter/inc/bf_svx/editdata.hxx b/binfilter/inc/bf_svx/editdata.hxx
index a160e9b..9892a0b 100644
--- a/binfilter/inc/bf_svx/editdata.hxx
+++ b/binfilter/inc/bf_svx/editdata.hxx
@@ -46,12 +46,6 @@ class SvxFieldItem;
enum EETextFormat { EE_FORMAT_TEXT = 0x20, EE_FORMAT_RTF, EE_FORMAT_BIN = 0x31, EE_FORMAT_HTML, EE_FORMAT_XML };
enum EEHorizontalTextDirection { EE_HTEXTDIR_DEFAULT, EE_HTEXTDIR_L2R, EE_HTEXTDIR_R2L };
-enum EESelectionMode { EE_SELMODE_STD, EE_SELMODE_TXTONLY };
-enum EESpellState { EE_SPELL_OK, EE_SPELL_NOLANGUAGE, EE_SPELL_LANGUAGENOTINSTALLED, EE_SPELL_NOSPELLER, EE_SPELL_ERRORFOUND };
-enum EVAnchorMode {
- ANCHOR_TOP_LEFT, ANCHOR_VCENTER_LEFT, ANCHOR_BOTTOM_LEFT,
- ANCHOR_TOP_HCENTER, ANCHOR_VCENTER_HCENTER, ANCHOR_BOTTOM_HCENTER,
- ANCHOR_TOP_RIGHT, ANCHOR_VCENTER_RIGHT, ANCHOR_BOTTOM_RIGHT };
#define EE_PARA_NOT_FOUND 0xFFFF
#define EE_PARA_APPEND 0xFFFF
More information about the Libreoffice-commits
mailing list