summaryrefslogtreecommitdiff
path: root/editeng/source/rtf
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/rtf')
-rw-r--r--editeng/source/rtf/makefile.mk50
-rw-r--r--editeng/source/rtf/rtfgrf.cxx14
-rw-r--r--editeng/source/rtf/rtfitem.cxx54
-rw-r--r--editeng/source/rtf/svxrtf.cxx65
4 files changed, 22 insertions, 161 deletions
diff --git a/editeng/source/rtf/makefile.mk b/editeng/source/rtf/makefile.mk
deleted file mode 100644
index 228683cdba..0000000000
--- a/editeng/source/rtf/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# 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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=editeng
-TARGET=rtf
-ENABLE_EXCEPTIONS=TRUE
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES= \
- $(SLO)$/rtfitem.obj \
- $(SLO)$/svxrtf.obj
-
-SLOFILES= \
- $(EXCEPTIONSFILES) \
- $(SLO)$/rtfgrf.obj
-
-# ==========================================================================
-
-.INCLUDE : target.mk
-
diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index f8053f03c7..d7a30707c8 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_editeng.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
#include <osl/endian.h>
#include <tools/cachestr.hxx>
#include <vcl/graph.hxx>
@@ -73,12 +73,12 @@ void GrfWindow::Paint( const Rectangle& )
}
#endif
-static BYTE __FAR_DATA aPal1[ 2 * 4 ] = {
+static BYTE aPal1[ 2 * 4 ] = {
0x00, 0x00, 0x00, 0x00, // Schwarz
0xFF, 0xFF, 0xFF, 0x00 // Weiss
};
-static BYTE __FAR_DATA aPal4[ 16 * 4 ] = {
+static BYTE aPal4[ 16 * 4 ] = {
0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00,
@@ -97,7 +97,7 @@ static BYTE __FAR_DATA aPal4[ 16 * 4 ] = {
0xFF, 0xFF, 0xFF, 0x00
};
-static BYTE __FAR_DATA aPal8[ 256 * 4 ] =
+static BYTE aPal8[ 256 * 4 ] =
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00,
0x80, 0x92, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x80, 0x00, 0xAA, 0x00,
@@ -423,8 +423,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
rPicType.uPicLen = nTokenValue;
if (rPicType.uPicLen)
{
- ULONG nPos = rStrm.Tell();
- nPos = nPos;
rStrm.SeekRel(-1);
sal_uInt8 aData[4096];
ULONG nSize = sizeof(aData);
@@ -440,8 +438,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
}
nNextCh = GetNextChar();
bValidBmp = !pTmpFile->GetError();
- nPos = rStrm.Tell();
- nPos = nPos;
}
break;
case RTF_PICSCALEX: rPicType.nScalX = nVal; break;
@@ -585,4 +581,4 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
return bValidBmp;
}
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 4f0ecccef7..30fa89178b 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -311,34 +312,6 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
pAkt->nStyleNo = USHORT( nStyleNo );
-#if 0
-// JP 05.09.95: zuruecksetzen der Style-Attribute fuehrt nur zu Problemen.
-// Es muss reichen, wenn das ueber pard/plain erfolgt
-// ansonsten Bugdoc 15304.rtf - nach nur "\pard" falscher Font !!
-
- SvxRTFStyleType* pStyle = aStyleTbl.Get( pAkt->nStyleNo );
- if( pStyle && pStyle->aAttrSet.Count() )
- {
- //JP 07.07.95:
- // alle Attribute, die in der Vorlage gesetzt werden
- // auf defaults setzen. In RTF werden die Attribute
- // der Vorlage danach ja wiederholt.
- // WICHTIG: Attribute die in der Vorlage definiert
- // sind, werden zurueckgesetzt !!!!
- // pAkt->aAttrSet.Put( pStyle->aAttrSet );
-
- SfxItemIter aIter( pStyle->aAttrSet );
- SfxItemPool* pPool = pStyle->aAttrSet.GetPool();
- USHORT nWh = aIter.GetCurItem()->Which();
- while( TRUE )
- {
- pAkt->aAttrSet.Put( pPool->GetDefaultItem( nWh ));
- if( aIter.IsAtEnd() )
- break;
- nWh = aIter.NextItem()->Which();
- }
- }
-#endif
}
break;
@@ -990,17 +963,9 @@ ATTR_SETOVERLINE:
PLAINID->nColor ));
}
break;
-#if 0
//#i12501# While cb is clearly documented in the rtf spec, word
//doesn't accept it at all
- case RTF_CB:
- if( PLAINID->nBgColor )
- {
- pSet->Put( SvxBrushItem( GetColor( USHORT(nTokenValue) ),
- PLAINID->nBgColor ));
- }
- break;
-#endif
+
case RTF_LANG:
if( PLAINID->nLanguage )
{
@@ -1627,10 +1592,15 @@ case RTF_BRDRBAR: break;
}
goto SETBORDERLINE;
- case RTF_BRDRS:
case RTF_BRDRDOT:
- case RTF_BRDRHAIR:
+ aBrd.SetStyle( DOTTED );
+ break;
case RTF_BRDRDASH:
+ aBrd.SetStyle( DASHED );
+ break;
+ case RTF_BRDRS:
+ case RTF_BRDRHAIR:
+ aBrd.SetStyle( SOLID );
SETBORDERLINE:
SetBorderLine( nBorderTyp, aAttr, aBrd );
break;
@@ -2051,9 +2021,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue )
// Verhaeltnis der def. TabWidth / Tabs errechnen und
// enstsprechend die neue Anzahl errechnen.
-/*-----------------14.12.94 19:32-------------------
- ?? wie kommt man auf die 13 ??
---------------------------------------------------*/
+ // ?? wie kommt man auf die 13 ??
USHORT nAnzTabs = (SVX_TAB_DEFDIST * 13 ) / USHORT(nValue);
/*
cmc, make sure we have at least one, or all hell breaks loose in
@@ -2098,4 +2066,4 @@ void SvxRTFParser::UnknownAttrToken( int, SfxItemSet* )
{
}
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 83222c7033..c8ecde5358 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,10 +67,10 @@ CharSet lcl_GetDefaultTextEncodingForRTF()
aLocale = Application::GetSettings().GetLocale();
aLangString = aLocale.Language;
- if ( aLangString.equals( ::rtl::OUString::createFromAscii( "ru" ) )
- || aLangString.equals( ::rtl::OUString::createFromAscii( "uk" ) ) )
+ if ( aLangString.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ru" )) )
+ || aLangString.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "uk" )) ) )
return RTL_TEXTENCODING_MS_1251;
- if ( aLangString.equals( ::rtl::OUString::createFromAscii( "tr" ) ) )
+ if ( aLangString.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "tr" )) ) )
return RTL_TEXTENCODING_MS_1254;
else
return RTL_TEXTENCODING_MS_1252;
@@ -180,13 +181,8 @@ void SvxRTFParser::Continue( int nToken )
if( SVPAR_PENDING != GetStatus() )
{
SetAllAttrOfStk();
-#if 0
//Regardless of what "color 0" is, word defaults to auto as the default colour.
//e.g. see #i7713#
- if( bNewDoc && ((RTFPlainAttrMapIds*)aPlainMap.GetData())->nColor )
- pAttrPool->SetPoolDefaultItem( SvxColorItem( GetColor( 0 ),
- ((RTFPlainAttrMapIds*)aPlainMap.GetData())->nColor ));
-#endif
}
}
@@ -293,10 +289,7 @@ INSINGLECHAR:
case RTF_TC:
case RTF_NEXTFILE:
case RTF_TEMPLATE:
-#if 0
- //disabled for #i19718#
- case RTF_SHPRSLT: // RTF_SHP fehlt noch !!
-#endif
+ // RTF_SHPRSLT disabled for #i19718#
SkipGroup();
break;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -440,9 +433,6 @@ void SvxRTFParser::ReadStyleTable()
if( '{' == GetStackPtr( -1 )->nTokenId )
{
nToken = SkipToken( -1 );
-#if 0
- --_nOpenBrakets; // korrigieren!!
-#endif
}
}
ReadAttr( nToken, &pStyle->aAttrSet );
@@ -991,12 +981,6 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
if( ( pOld->pSttNd->GetIdx() < pInsPos->GetNodeIdx() ||
( pOld->pSttNd->GetIdx() == pInsPos->GetNodeIdx() &&
pOld->nSttCnt <= pInsPos->GetCntIdx() ))
-#if 0
-//BUG 68555 - dont test for empty paragraph or any range
- && ( nOldSttNdIdx != pInsPos->GetNodeIdx() ||
- pOld->nSttCnt != pInsPos->GetCntIdx() ||
- !pOld->nSttCnt )
-#endif
)
{
if( !bCrsrBack )
@@ -1005,25 +989,6 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
// Absatz !!
if( nOldSttNdIdx == pInsPos->GetNodeIdx() )
{
-#if 0
-//BUG 68555 - dont reset pard attrs, if the group not begins not at start of
-// paragraph
- // Bereich innerhalb eines Absatzes:
- // alle Absatz-Attribute und StyleNo loeschen
- // aber nur wenn mitten drin angefangen wurde
- if( pOld->nSttCnt )
- {
- pOld->nStyleNo = 0;
- for( USHORT n = 0; n < aPardMap.Count() &&
- pOld->aAttrSet.Count(); ++n )
- if( aPardMap[n] )
- pOld->aAttrSet.ClearItem( aPardMap[n] );
-
- if( !pOld->aAttrSet.Count() && !pOld->pChildList &&
- !pOld->nStyleNo )
- break; // auch dieser verlaesst uns jetzt
- }
-#endif
}
else
{
@@ -1082,10 +1047,6 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
pOld->pEndNd = pInsPos->MakeNodeIdx();
pOld->nEndCnt = pInsPos->GetCntIdx();
-#if 0
- if( IsChkStyleAttr() )
- _ClearStyleAttr( *pOld );
-#else
/*
#i21422#
If the parent (pAkt) sets something e.g. , and the child (pOld)
@@ -1098,7 +1059,6 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen
*/
if (IsChkStyleAttr() && !pAkt)
_ClearStyleAttr( *pOld );
-#endif
if( pAkt )
{
@@ -1294,18 +1254,6 @@ void SvxRTFItemStackType::Add( SvxRTFItemStackType* pIns )
pChildList->Insert( pIns, pChildList->Count() );
}
-#if 0
-//cmc: This is the original. nEndCnt is redundantly assigned to itself, and
-//pEndNd can leak if not equal to pSttNd.
-void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos )
-{
- delete pSttNd;
- pSttNd = rPos.MakeNodeIdx();
- nSttCnt = rPos.GetCntIdx();
- pEndNd = pSttNd;
- nEndCnt = nEndCnt;
-}
-#else
void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos )
{
if (pSttNd != pEndNd)
@@ -1315,7 +1263,6 @@ void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos )
pEndNd = pSttNd;
nSttCnt = rPos.GetCntIdx();
}
-#endif
void SvxRTFItemStackType::MoveFullNode(const SvxNodeIdx &rOldNode,
const SvxNodeIdx &rNewNode)
@@ -1515,4 +1462,4 @@ RTFPardAttrMapIds ::RTFPardAttrMapIds ( const SfxItemPool& rPool )
nDirection = rPool.GetTrueWhich( SID_ATTR_FRAMEDIRECTION, FALSE );
}
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */