summaryrefslogtreecommitdiffstats
path: root/rsc
diff options
context:
space:
mode:
authorMatthias Huetsch [mhu] <matthias.huetsch@oracle.com>2011-01-27 18:16:28 +0100
committerMatthias Huetsch [mhu] <matthias.huetsch@oracle.com>2011-01-27 18:16:28 +0100
commit45893f9a2740eb9c291476df4eaa3700003f0efd (patch)
treea7e2381af1a4136eb18b89b55af639306c9fc2c0 /rsc
parentUpdate from sibling repository. (diff)
parentmasterfix: #i10000# #i116562# kde patch (diff)
downloadcore-45893f9a2740eb9c291476df4eaa3700003f0efd.tar.gz
core-45893f9a2740eb9c291476df4eaa3700003f0efd.zip
Update from master repository (DEV300_m98).
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rsc/rscsfx.hxx (renamed from rsc/inc/rscsfx.hxx)0
-rw-r--r--rsc/inc/rscdb.hxx2
-rw-r--r--rsc/inc/vclrsc.hxx179
-rw-r--r--rsc/prj/d.lst2
-rw-r--r--rsc/source/parser/erscerr.cxx2
-rw-r--r--rsc/source/parser/rscdb.cxx6
-rw-r--r--rsc/source/parser/rscibas.cxx4
-rw-r--r--rsc/source/parser/rscicpx.cxx13
-rw-r--r--rsc/source/parser/rscinit.cxx4
-rwxr-xr-x[-rw-r--r--]rsc/source/parser/rsclex.cxx11
-rw-r--r--rsc/source/parser/rscyacc.cxx4
-rw-r--r--rsc/source/rsc/rsc.cxx170
-rw-r--r--rsc/source/tools/rsctools.cxx6
13 files changed, 105 insertions, 298 deletions
diff --git a/rsc/inc/rscsfx.hxx b/rsc/inc/rsc/rscsfx.hxx
index 830bbcf37baa..830bbcf37baa 100644
--- a/rsc/inc/rscsfx.hxx
+++ b/rsc/inc/rsc/rscsfx.hxx
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 1d5af35de9ff..cbdf5a326a43 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -142,7 +142,6 @@ class RscTypCont
Atom nTopImageId;
Atom nNoLabelId;
Atom nVertId;
- Atom nSingleLineId;
Atom nSysWinId;
void Init(); // Initialisiert Klassen und Tabelle
@@ -285,6 +284,7 @@ public:
RscRange a0to9999Short;
RscIdRange aIdLong;
RscString aString;
+ RscString aStringLiteral;
RscFlag aWinBits;
RscLangEnum aLangType;
RscLangArray aLangString;
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 19677171dcb2..11b3f57c1dd2 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -30,152 +30,9 @@
#include <sal/types.h>
#include <tools/solar.h>
-
-// ---------------
-// - Window-Bits -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-typedef sal_Int64 WinBits;
-
-// Window-Bits fuer Window
-#define WB_CLIPCHILDREN ((WinBits)0x00000001)
-#define WB_DIALOGCONTROL ((WinBits)0x00000002)
-#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
-#define WB_BORDER ((WinBits)0x00000008)
-#define WB_NOBORDER ((WinBits)0x00000010)
-#define WB_SIZEABLE ((WinBits)0x00000020)
-#define WB_3DLOOK ((WinBits)0x00000040)
-#define WB_AUTOSIZE ((WinBits)0x00000080)
-
-// Window-Bits fuer SystemWindows
-#define WB_MOVEABLE ((WinBits)0x00000100)
-#define WB_ROLLABLE ((WinBits)0x00000200)
-#define WB_CLOSEABLE ((WinBits)0x00000400)
-#define WB_STANDALONE ((WinBits)0x00000800)
-#define WB_APP ((WinBits)0x00001000)
-#define WB_PINABLE ((WinBits)0x00002000)
-#define WB_SYSTEMWINDOW ((WinBits)0x40000000)
-#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
-
-// Standard-Window-Bits fuer ChildWindows
-#define WB_TABSTOP ((WinBits)0x00000100)
-#define WB_NOTABSTOP ((WinBits)0x00000200)
-#define WB_GROUP ((WinBits)0x00000400)
-#define WB_NOGROUP ((WinBits)0x00000800)
-#define WB_HORZ ((WinBits)0x00001000)
-#define WB_VERT ((WinBits)0x00002000)
-#define WB_LEFT ((WinBits)0x00004000)
-#define WB_CENTER ((WinBits)0x00008000)
-#define WB_RIGHT ((WinBits)0x00010000)
-#define WB_TOP ((WinBits)0x00020000)
-#define WB_VCENTER ((WinBits)0x00040000)
-#define WB_BOTTOM ((WinBits)0x00080000)
-#define WB_DRAG ((WinBits)0x00100000)
-#define WB_SPIN ((WinBits)0x00200000)
-#define WB_REPEAT ((WinBits)0x00400000)
-#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
-#define WB_WORDBREAK ((WinBits)0x01000000)
-#define WB_NOLABEL ((WinBits)0x02000000)
-#define WB_SORT ((WinBits)0x04000000)
-#define WB_DROPDOWN ((WinBits)0x08000000)
-#define WB_AUTOHSCROLL ((WinBits)0x10000000)
-#define WB_DOCKABLE ((WinBits)0x20000000)
-#define WB_AUTOVSCROLL ((WinBits)0x40000000)
-
-#define WB_HIDE ((WinBits)0x80000000)
-#define WB_HSCROLL WB_HORZ
-#define WB_VSCROLL WB_VERT
-#define WB_TOPIMAGE WB_TOP
-
-// Window-Bits for PushButtons
-#define WB_DEFBUTTON ((WinBits)0x10000000)
-#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
-#define WB_RECTSTYLE ((WinBits)0x08000000)
-#define WB_SMALLSTYLE ((WinBits)0x04000000)
-
-// Window-Bits for FixedText
-#define WB_INFO ((WinBits)0x20000000)
-#define WB_PATHELLIPSIS ((WinBits)0x00100000)
-
-// Window-Bits for Edit
-#define WB_PASSWORD ((WinBits)0x01000000)
-#define WB_READONLY ((WinBits)0x02000000)
-#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
-
-// Window-Bits for MultiLineEdit
-#define WB_IGNORETAB ((WinBits)0x20000000)
-
-// Window-Bits for ListBox and MultiListBox
-#define WB_SIMPLEMODE ((WinBits)0x20000000)
-
-// Window-Bits for FixedBitmap
-#define WB_FAST ((WinBits)0x04000000)
-#define WB_SCALE ((WinBits)0x08000000)
-#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
-
-// Window-Bits for ToolBox
-#define WB_LINESPACING ((WinBits)0x01000000)
-#define WB_SCROLL ((WinBits)0x02000000)
-
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
-// Window-Bits for DockingWindows
-#define WB_DOCKBORDER ((WinBits)0x00001000)
-
-// Window-Bits for SplitWindow
-#define WB_NOSPLITDRAW ((WinBits)0x01000000)
-#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
-
-// Window-Bits for MessageBoxen
-#define WB_OK ((WinBits)0x00100000)
-#define WB_OK_CANCEL ((WinBits)0x00200000)
-#define WB_YES_NO ((WinBits)0x00400000)
-#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
-#define WB_RETRY_CANCEL ((WinBits)0x01000000)
-#define WB_DEF_OK ((WinBits)0x02000000)
-#define WB_DEF_CANCEL ((WinBits)0x04000000)
-#define WB_DEF_RETRY ((WinBits)0x08000000)
-#define WB_DEF_YES ((WinBits)0x10000000)
-#define WB_DEF_NO ((WinBits)0x20000000)
-#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Standard-WinBits
-#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
-#define WB_STDMDI (WB_CLOSEABLE)
-#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
-#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDMODELESS (WB_STDDIALOG)
-#define WB_STDMODAL (WB_STDDIALOG)
-#define WB_STDTABDIALOG (WB_STDDIALOG)
-#define WB_STDTABCONTROL 0
-
-// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
-
-// --------------
-// - Help-Types -
-// --------------
-
-// from vcl/inc/help.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
-
-// --------------
-// - FieldTypes -
-// --------------
-
-// from vcl/inc/fldunit.hxx
-enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
- FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
- FUNIT_PERCENT, FUNIT_100TH_MM };
-
+#include <tools/wintypes.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/mapunit.hxx>
// from vcl/inc/vclenum.hxx
#ifndef ENUM_TIMEFIELDFORMAT_DECLARED
@@ -215,25 +72,6 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE,
#endif
-// ------------
-// - TriState -
-// ------------
-
-// from vcl/inc/wintypes.hxx
-enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
-
-// -----------------
-// - MapMode-Types -
-// -----------------
-
-// from vcl/inc/mapmod.hxx
-enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
- MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
- MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
- MAP_RELATIVE, MAP_REALAPPFONT };
-
-// Das Resourcesystem benutzt den Wert 0xFFFF (freihalten)
-
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -270,14 +108,6 @@ typedef sal_uInt16 WindowBorderStyle;
#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010)
#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000)
-// ---------------
-// - WindowAlign -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
-enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM };
-
// --------------
// - Menu-Types -
// --------------
@@ -336,9 +166,6 @@ typedef sal_uInt16 SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/rsc/prj/d.lst b/rsc/prj/d.lst
index e59c9b2e9f3a..e79c03d9bb63 100644
--- a/rsc/prj/d.lst
+++ b/rsc/prj/d.lst
@@ -6,4 +6,4 @@
..\%__SRC%\bin\rscpp %_DEST%\bin%_EXT%\rscpp
mkdir: %_DEST%\inc%_EXT%\rsc
-..\inc\rscsfx.hxx %_DEST%\inc%_EXT%\rsc\rscsfx.hxx
+..\inc\rsc/rscsfx.hxx %_DEST%\inc%_EXT%\rsc\rscsfx.hxx
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index 158aea21b6e3..ed63510737aa 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -88,10 +88,8 @@ void RscError::StdOut( const char * pStr, const RscVerbosity _verbosityLevel )
*************************************************************************/
void RscError::StdErr( const char * pStr )
{
-#ifndef WIN
if( pStr )
fprintf( stderr, "%s", pStr );
-#endif
}
/*************************************************************************
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 97d23d4e3b53..af176fe24934 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -81,6 +81,7 @@ RscTypCont :: RscTypCont( RscError * pErrHdl,
a0to9999Short( pHS->getID( "YearShort" ), RSC_NOTYPE ),
aIdLong( pHS->getID( "IDLONG" ), RSC_NOTYPE ),
aString( pHS->getID( "Chars" ), RSC_NOTYPE ),
+ aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ),
aWinBits( pHS->getID( "WinBits" ), RSC_NOTYPE ),
aLangType(),
aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ),
@@ -125,7 +126,7 @@ static sal_uInt32 getLangIdAndShortenLocale( RscTypCont* pTypCont,
else
rLang = rtl::OString();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, " %s (0x%hx)", aL.getStr(), nRet );
+ fprintf( stderr, " %s (0x%hx)", aL.getStr(), (int)nRet );
#endif
return nRet;
}
@@ -902,7 +903,7 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey )
fprintf( fOutput, "#include <vcl/fixed.hxx>\n" );
fprintf( fOutput, "#include <vcl/group.hxx>\n" );
fprintf( fOutput, "#include <vcl/image.hxx>\n" );
- fprintf( fOutput, "#include <vcl/imagebtn.hxx>\n" );
+ fprintf( fOutput, "#include <vcl/button.hxx>\n" );
fprintf( fOutput, "#include <vcl/keycod.hxx>\n" );
fprintf( fOutput, "#include <vcl/lstbox.hxx>\n" );
fprintf( fOutput, "#include <vcl/mapmod.hxx>\n" );
@@ -1112,3 +1113,4 @@ sal_uInt32 RscTypCont::PutTranslatorKey( sal_uInt64 nKey )
aIdTranslator[ nKey ] = nFilePos;
return nPMId++;
}
+
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 1a896c897e27..a60db4f54d2f 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -102,7 +102,7 @@ void RscLangEnum::Init( RscNameTable& rNames )
while ( NULL != ( pLangEntry = MsLangId::getIsoLangEntry( nIndex )) && ( pLangEntry->mnLang != LANGUAGE_DONTKNOW ))
{
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "ISO Language in : %d %d %s\n",
+ fprintf( stderr, "ISO Language in : %d\n",
(int)nIndex,
pLangEntry->mnLang,
MsLangId::convertLanguageToIsoByteString( pLangEntry->mnLang ).getStr() );
@@ -200,7 +200,7 @@ Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
mnLangId++;
}
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "AddLanguage( %s ) = 0x%lx\n", pLang, nResult );
+ fprintf( stderr, "AddLanguage( %s ) = %d\n", pLang, nResult );
#endif
return nResult;
}
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 625417769f45..8b9a088c76cc 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -40,7 +40,7 @@
#include <rscclass.hxx>
#include <rsccont.hxx>
#include <rscdb.hxx>
-#include <rscsfx.hxx>
+#include <rsc/rscsfx.hxx>
#include "rsclex.hxx"
#include <yyrscyacc.hxx>
@@ -297,7 +297,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
InsWinBit( pClassWindow, "DialogControl", nTabControlId );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassWindow->SetVariable( nId, &aIdLong );
+ pClassWindow->SetVariable( nId, &aStringLiteral, NULL, 0, WINDOW_HELPID );
nRsc_XYMAPMODEId = nId = aNmTb.Put( "_XYMapMode", VARNAME );
@@ -325,7 +325,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
nId = aNmTb.Put( "ExtraLong", VARNAME );
pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_EXTRALONG );
nId = aNmTb.Put( "UniqueId", VARNAME );
- pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_UNIQUEID );
+ pClassWindow->SetVariable( nId, &aString, NULL, 0, WINDOW_UNIQUEID );
// BorderStyle
RscEnum* pBorderStyleEnum = new RscEnum( pHS->getID( "WindowBorderStyle" ), RSC_NOTYPE );
@@ -1201,7 +1201,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0,
RSC_MENUITEM_HELPTEXT );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMenuItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassMenuItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_MENUITEM_HELPID );
nId = aNmTb.Put( "AccelKey", VARNAME );
pClassMenuItem->SetVariable( nId, pClassKeyCode, NULL, 0,
@@ -1276,7 +1276,7 @@ RscTop * RscTypCont::InitClassMessBox( RscTop * pSuper,
nId = aNmTb.Put( "DefButton", VARNAME );
pClassMessBox->SetVariable( nId, pMessDefButton );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMessBox->SetVariable( nId, &aIdLong );
+ pClassMessBox->SetVariable( nId, &aStringLiteral );
nId = aNmTb.Put( "SysModal", VARNAME );
pClassMessBox->SetVariable( nId, &aBool );
nId = aNmTb.Put( "Title", VARNAME );
@@ -2015,7 +2015,7 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
}
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassToolBoxItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_TOOLBOXITEM_HELPID );
nId = aNmTb.Put( "Text", VARNAME );
pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0,
@@ -2277,7 +2277,6 @@ RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper,
pClassTabControl->SetVariable( nId, pCont, NULL, 0,
RSC_TABCONTROL_ITEMLIST );
- INS_WINBIT( pClassTabControl, SingleLine );
INS_WINBIT( pClassTabControl, DropDown );
}
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index a763b92f0bb1..aded8db5f865 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -210,9 +210,11 @@ void RscTypCont::Init()
aNmTb.Put( "TRUE", BOOLEAN, (long)TRUE );
aNmTb.Put( "FALSE", BOOLEAN, (long)FALSE );
+ #if 0
/* Vordefinierte HilfeId's */
aNmTb.Put( "HELP_INDEX", NUMBER, OOO_HELP_INDEX );
aNmTb.Put( "HELP_HELPONHELP", NUMBER, OOO_HELP_HELPONHELP );
+ #endif
aNmTb.Put( "XSCALE", XSCALE , (long)0 );
aNmTb.Put( "YSCALE", YSCALE , (long)0 );
@@ -370,8 +372,6 @@ void RscTypCont::Init()
aWinBits.SetConstant( nNoLabelId, sal::static_int_cast<INT32>(WB_NOLABEL) );
nVertId = pHS->getID( "WB_VERT" );
aWinBits.SetConstant( nVertId, sal::static_int_cast<INT32>(WB_VERT) );
- nSingleLineId = pHS->getID( "WB_SINGLELINE" );
- aWinBits.SetConstant( nSingleLineId, sal::static_int_cast<INT32>(WB_SINGLELINE) );
nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" );
aWinBits.SetConstant( nSysWinId, sal::static_int_cast<INT32>(WB_SYSTEMWINDOW) );
}
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index e0df5de254f9..76ec4c551d52 100644..100755
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -175,11 +175,16 @@ int MakeToken( YYSTYPE * pTokenVal ){
c = pFI->GetFastChar();
if( c == '"' )
{
- c = pFI->GetFastChar();
+ do
+ {
+ c = pFI->GetFastChar();
+ }
+ while( c == ' ' || c == '\t' );
if( c == '"' )
{
- aBuf.append( '"' );
- aBuf.append( '"' );
+ // this is a continued string
+ // note: multiline string continuations are handled by the parser
+ // see rscyacc.y
}
else
bDone = TRUE;
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index 89891581d9ba..0d5cc8faef0e 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -253,12 +253,8 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
#ifdef UNX
#define YYMAXDEPTH 2000
#else
-#ifdef W30
-#define YYMAXDEPTH 300
-#else
#define YYMAXDEPTH 800
#endif
-#endif
#if defined _MSC_VER
#pragma warning(push, 1)
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 40d589aea359..54073563403d 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -66,12 +66,14 @@
#include <rschash.hxx>
#include <osl/file.h>
+#include <osl/file.hxx>
#include <osl/process.h>
#include <rtl/strbuf.hxx>
#include <rtl/tencinfo.h>
#include <rtl/textenc.h>
#include <vector>
+#include <algorithm>
using namespace rtl;
@@ -474,10 +476,8 @@ ERRTYPE RscCompiler::Start()
if( PRINTSYNTAX_FLAG & pCL->nCommands )
{
-#ifndef W30
pTC->WriteSyntax( stdout );
-printf( "khg\n" );
-#endif
+ printf( "khg\n" );
return ERR_OK;
}
@@ -726,7 +726,7 @@ ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey )
*************************************************************************/
ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
const RscCmdLine::OutputFile* pOutputFile,
- const WriteRcContext* pContext )
+ const WriteRcContext* pContext )
{
FILE * finput = NULL;
ERRTYPE aError;
@@ -804,13 +804,36 @@ ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
|*
*************************************************************************/
-static OString do_prefix( const char* pPrefix, const OUString& rFile )
+namespace
{
- OStringBuffer aBuf(256);
- aBuf.append( pPrefix );
- aBuf.append( ":" );
- aBuf.append( OUStringToOString( rFile, RTL_TEXTENCODING_MS_1252 ) );
- return aBuf.makeStringAndClear();
+ using namespace ::osl;
+ class RscIoError { };
+ static inline OUString lcl_getAbsoluteUrl(const OUString& i_sBaseUrl, const OString& i_sPath)
+ {
+ OUString sRelUrl, sAbsUrl;
+ if(FileBase::getFileURLFromSystemPath(OStringToOUString(i_sPath, RTL_TEXTENCODING_MS_1252), sRelUrl) != FileBase::E_None)
+ throw RscIoError();
+ if(FileBase::getAbsoluteFileURL(i_sBaseUrl, sRelUrl, sAbsUrl) != FileBase::E_None)
+ throw RscIoError();
+ return sAbsUrl;
+ };
+ static inline OString lcl_getSystemPath(const OUString& i_sUrl)
+ {
+ OUString sSys;
+ if(FileBase::getSystemPathFromFileURL(i_sUrl, sSys) != FileBase::E_None)
+ throw RscIoError();
+ OSL_TRACE("temporary file: %s", OUStringToOString(sSys, RTL_TEXTENCODING_UTF8).getStr());
+ return OUStringToOString(sSys, RTL_TEXTENCODING_MS_1252);
+ };
+ static inline OString lcl_getTempFile(OUString& sTempDirUrl)
+ {
+ // get a temp file name for the rc file
+ OUString sTempUrl;
+ if(FileBase::createTempFile(&sTempDirUrl, NULL, &sTempUrl) != FileBase::E_None)
+ throw RscIoError();
+ OSL_TRACE("temporary url: %s", OUStringToOString(sTempUrl, RTL_TEXTENCODING_UTF8).getStr());
+ return lcl_getSystemPath(sTempUrl);
+ };
}
ERRTYPE RscCompiler::Link()
@@ -819,12 +842,6 @@ ERRTYPE RscCompiler::Link()
ERRTYPE aError;
RscFile* pFName;
-#ifdef UNX
-#define PATHSEP '/'
-#else
-#define PATHSEP '\\'
-#endif
-
if( !(pCL->nCommands & NOLINK_FLAG) )
{
::std::list<RscCmdLine::OutputFile>::const_iterator it;
@@ -842,87 +859,55 @@ ERRTYPE RscCompiler::Link()
}
}
- // rc-Datei schreiben
- ByteString aDir( it->aOutputRc );
- aDir.SetToken( aDir.GetTokenCount( PATHSEP )-1, PATHSEP, ByteString() );
- if( ! aDir.Len() )
- {
- char aBuf[1024];
- if( getcwd( aBuf, sizeof( aBuf ) ) )
- {
- aDir = aBuf;
- aDir.Append( PATHSEP );
- }
- }
- // work dir for absolute Urls
- OUString aCWD, aTmpUrl;
- osl_getProcessWorkingDir( &aCWD.pData );
-
// get two temp file urls
OString aRcTmp, aSysListTmp, aSysList;
- OUString aSysPath, aUrlDir;
- aSysPath = OStringToOUString( aDir, RTL_TEXTENCODING_MS_1252 );
- if( osl_getFileURLFromSystemPath( aSysPath.pData, &aUrlDir.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "url conversion", aUrlDir ) );
-
- if( osl_getAbsoluteFileURL( aCWD.pData, aUrlDir.pData, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "absolute url", aUrlDir ) );
- aUrlDir = aTmpUrl;
-
- // create temp file for rc target
- if( osl_createTempFile( aUrlDir.pData, NULL, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "temp file creation", aUrlDir ) );
+ try
+ {
+ OUString sPwdUrl;
+ osl_getProcessWorkingDir( &sPwdUrl.pData );
+ OUString sRcUrl = lcl_getAbsoluteUrl(sPwdUrl, it->aOutputRc);
+ // TempDir is either the directory where the rc file is located or pwd
+ OUString sTempDirUrl = sRcUrl.copy(0,sRcUrl.lastIndexOf('/'));
+ OSL_TRACE("rc directory URL: %s", OUStringToOString(sTempDirUrl, RTL_TEXTENCODING_UTF8).getStr());
+
+ aRcTmp = lcl_getTempFile(sTempDirUrl);
+ OSL_TRACE("temporary rc file: %s", aRcTmp.getStr());
+
+ OUString sOilDirUrl;
+ if(pCL->aILDir.Len())
+ sOilDirUrl = lcl_getAbsoluteUrl(sPwdUrl, pCL->aILDir);
+ else
+ sOilDirUrl = sTempDirUrl;
+ OSL_TRACE("ilst directory URL: %s", OUStringToOString(sOilDirUrl, RTL_TEXTENCODING_UTF8).getStr());
- if( osl_getSystemPathFromFileURL( aTmpUrl.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aTmpUrl ) );
- aRcTmp = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
+ aSysListTmp = lcl_getTempFile(sOilDirUrl);
+ OSL_TRACE("temporary ilst file: %s", aSysListTmp.getStr());
- if ( NULL == (fExitFile = foutput = fopen( aRcTmp.getStr(), "wb" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() );
+ OUString sIlstUrl, sIlstSys;
+ sIlstUrl = sRcUrl.copy(sRcUrl.lastIndexOf('/')+1);
+ sIlstUrl = sIlstUrl.copy(0,sIlstUrl.lastIndexOf('.'));
+ sIlstUrl += OUString::createFromAscii(".ilst");
+ sIlstUrl = lcl_getAbsoluteUrl(sOilDirUrl, OUStringToOString(sIlstUrl, RTL_TEXTENCODING_UTF8));
- // make absolute path from IL dir (-oil switch)
- // if no -oil was given, use the same dir as for rc file
- if( pCL->aILDir.Len() )
+ aSysList = lcl_getSystemPath(sIlstUrl);
+ OSL_TRACE("ilst file: %s", aSysList.getStr());
+ }
+ catch (RscIoError&)
{
- aSysPath = OStringToOUString( pCL->aILDir, RTL_TEXTENCODING_MS_1252 );
- if( osl_getFileURLFromSystemPath( aSysPath.pData, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "url conversion", aSysPath ) );
- if( osl_getAbsoluteFileURL( aCWD.pData, aTmpUrl.pData, &aUrlDir.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "absolute url", aTmpUrl ) );
+ OString sMsg("Error with paths:\n");
+ sMsg += "temporary rc file: " + aRcTmp + "\n";
+ sMsg += "temporary ilst file: " + aSysListTmp + "\n";
+ sMsg += "ilst file: " + aSysList + "\n";
+ pTC->pEH->FatalError(ERR_OPENFILE, RscId(), sMsg);
}
-
- if( osl_getSystemPathFromFileURL( aUrlDir.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aUrlDir ) );
-
- aSysList = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
- aSysList = aSysList + "/";
- xub_StrLen nLastSep = it->aOutputRc.SearchBackward( PATHSEP );
- if( nLastSep == STRING_NOTFOUND )
- nLastSep = 0;
- xub_StrLen nLastPt = it->aOutputRc.Search( '.', nLastSep );
- if( nLastPt == STRING_NOTFOUND )
- nLastPt = it->aOutputRc.Len()+1;
- aSysList = aSysList + it->aOutputRc.Copy( nLastSep+1, nLastPt - nLastSep-1 );
- aSysList = aSysList + ".ilst";
- // create temp file for sys list target
- if( osl_createTempFile( aUrlDir.pData, NULL, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "temp file creation", aUrlDir ) );
-
- if( osl_getSystemPathFromFileURL( aTmpUrl.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aTmpUrl ) );
- aSysListTmp = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
-
- pTC->pEH->StdOut( "Generating .rc file\n" );
-
- rtl_TextEncoding aEnc = RTL_TEXTENCODING_UTF8;
- //if( it->aLangName.CompareIgnoreCaseToAscii( "de", 2 ) == COMPARE_EQUAL )
- // aEnc = RTL_TEXTENCODING_MS_1252;
+ if ( NULL == (fExitFile = foutput = fopen( aRcTmp.getStr(), "wb" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() );
// Schreibe Datei
sal_Char cSearchDelim = ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
sal_Char cAccessDelim = ByteString( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
pTC->ChangeLanguage( it->aLangName );
- pTC->SetSourceCharSet( aEnc );
+ pTC->SetSourceCharSet( RTL_TEXTENCODING_UTF8 );
pTC->ClearSysNames();
ByteString aSysSearchPath( it->aLangSearchPath );
xub_StrLen nIndex = 0;
@@ -938,9 +923,7 @@ ERRTYPE RscCompiler::Link()
aSysSearchPath.Append( cSearchDelim );
aSysSearchPath.Append( aToken );
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "setting search path for language %s: %s\n", it->aLangName.GetBuffer(), aSysSearchPath.GetBuffer() );
-#endif
+ OSL_TRACE( "setting search path for language %s: %s\n", it->aLangName.GetBuffer(), aSysSearchPath.GetBuffer() );
pTC->SetSysSearchPath( aSysSearchPath );
WriteRcContext aContext;
@@ -1155,7 +1138,7 @@ void RscCompiler::OpenInput( const ByteString& rInput )
|*************************************************************************/
bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
+ const WriteRcContext& rContext,
const ByteString& rBaseFileName,
ByteString& rImagePath,
FILE* pSysListFile )
@@ -1245,9 +1228,9 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
// ------------------------------------------------------------------------------
void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
- const DirEntry& rSrsInPath,
- const DirEntry& rSrsOutPath )
+ const WriteRcContext& rContext,
+ const DirEntry& rSrsInPath,
+ const DirEntry& rSrsOutPath )
{
SvFileStream aIStm( rSrsInPath.GetFull(), STREAM_READ );
SvFileStream aOStm( rSrsOutPath.GetFull(), STREAM_WRITE | STREAM_TRUNC );
@@ -1355,7 +1338,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
}
aOStm.WriteLine( "};" );
- }
+ }
else
aOStm.WriteLine( aLine );
}
@@ -1384,3 +1367,4 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
if( pSysListFile )
fclose( pSysListFile );
}
+
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 9904cd20d4e7..93ecff2afe43 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -32,7 +32,7 @@
// C and C++ Includes.
#include <stdlib.h>
#include <stdio.h>
-#if defined ( DOS ) || defined ( WIN ) || defined (WNT )
+#if defined (WNT )
#include <direct.h>
#endif
#if defined ( OS2 ) && !defined ( GCC )
@@ -51,10 +51,6 @@
#include <rtl/alloc.h>
#include <rtl/memory.h>
-#if defined (WIN)
-#define ONLY_NEW
-#endif
-
using namespace rtl;
/****************** C o d e **********************************************/