summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-08 14:44:30 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-08 14:44:30 +0100
commit0abccb84f7eac705503c6cb904ed91864f5acab8 (patch)
treebdbe628ce84830955e34cb03ec8c33898e0c9c5e
parentda8aa1f2aa04522f098474fa93898ab8716841d0 (diff)
parent12be26b5e65b1d6e768a1249de7ee1e4b8727210 (diff)
CWS-TOOLING: integrate CWS vmiklos01
-rw-r--r--editeng/inc/editeng/svxrtf.hxx7
-rw-r--r--editeng/source/editeng/eertfpar.cxx1
-rw-r--r--editeng/source/rtf/makefile.mk3
-rw-r--r--editeng/source/rtf/rtfgrf.cxx36
4 files changed, 39 insertions, 8 deletions
diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx
index f1214f1283a6..10864b1850f1 100644
--- a/editeng/inc/editeng/svxrtf.hxx
+++ b/editeng/inc/editeng/svxrtf.hxx
@@ -38,7 +38,8 @@
#include <editeng/editengdllapi.h>
#include <deque>
-
+#include <utility>
+#include <vector>
class Font;
class Color;
class Graphic;
@@ -109,7 +110,7 @@ struct SvxRTFStyleType
// Bitmap - Mode
-
+typedef ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > PictPropertyNameValuePairs;
struct EDITENG_DLLPUBLIC SvxRTFPictureType
{
// Format der Bitmap
@@ -140,7 +141,7 @@ struct EDITENG_DLLPUBLIC SvxRTFPictureType
USHORT nWidthBytes;
USHORT nScalX, nScalY;
short nCropT, nCropB, nCropL, nCropR;
-
+ PictPropertyNameValuePairs aPropertyPairs;
SvxRTFPictureType() { ResetValues(); }
// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen !
void ResetValues();
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 9f919afb39d6..817949294444 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -54,6 +54,7 @@ void SvxRTFPictureType::ResetValues()
nBitsPerPixel = nPlanes = 1;
nScalX = nScalY = 100; // Skalierung in Prozent
nCropT = nCropB = nCropL = nCropR = 0;
+ aPropertyPairs.clear();
}
ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
diff --git a/editeng/source/rtf/makefile.mk b/editeng/source/rtf/makefile.mk
index 38b2ef7b45bc..081cd5b506cd 100644
--- a/editeng/source/rtf/makefile.mk
+++ b/editeng/source/rtf/makefile.mk
@@ -29,12 +29,11 @@ PRJ=..$/..
PRJNAME=editeng
TARGET=rtf
-
+ENABLE_EXCEPTIONS=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
# --- Files --------------------------------------------------------
EXCEPTIONSFILES= \
diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index 24fd4465b031..4b0051cd3c81 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -39,6 +39,7 @@
#include <editeng/svxrtf.hxx>
+using namespace ::rtl;
#ifndef DBG_UTIL
#undef DEBUG_JP
@@ -316,14 +317,26 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
if( RTF_SHPPICT == GetStackPtr(0)->nTokenId )
++nValidDataBraket;
-
+ OUString sShapePropertyName, sShapePropertyValue;
+ int nShapePropertyBracket = -1;
while( _nOpenBrakets && IsParserWorking() && bValidBmp )
{
nToken = GetNextToken();
USHORT nVal = USHORT( nTokenValue );
switch( nToken )
{
- case '}': --_nOpenBrakets; break;
+ case '}':
+ --_nOpenBrakets;
+ if( nShapePropertyBracket > 0 && nShapePropertyBracket > _nOpenBrakets )
+ {
+ nShapePropertyBracket = -1;
+ if( sShapePropertyName.getLength() )
+ {
+ rPicType.aPropertyPairs.push_back( ::std::pair< OUString, OUString >( sShapePropertyName, sShapePropertyValue ) );
+ sShapePropertyName = sShapePropertyValue = ::rtl::OUString();
+ }
+ }
+ break;
case '{':
{
if( RTF_IGNOREFLAG != GetNextToken() )
@@ -439,7 +452,24 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
case RTF_PICCROPB: rPicType.nCropB = (short)nTokenValue; break;
case RTF_PICCROPL: rPicType.nCropL = (short)nTokenValue; break;
case RTF_PICCROPR: rPicType.nCropR = (short)nTokenValue; break;
-
+ case RTF_SP:
+ //read pairs of {\sn Name}{\sv Value}
+ nShapePropertyBracket = _nOpenBrakets;
+ break;
+ case RTF_SN:
+ nToken = GetNextToken();
+ if( nToken != '}' )
+ sShapePropertyName = aToken;
+ else
+ nToken = SkipToken( -1 );
+ break;
+ case RTF_SV:
+ nToken = GetNextToken();
+ if( nToken != '}' )
+ sShapePropertyValue = aToken;
+ else
+ nToken = SkipToken( -1 );
+ break;
case RTF_TEXTTOKEN:
// JP 26.06.98: Bug #51719# - nur TextToken auf 1. Ebene
// auswerten. Alle anderen sind irgendwelche