Kaydet (Commit) fe8e4192 authored tarafından Philipp Riemer's avatar Philipp Riemer

fdo#39468: Translate German comments

Change-Id: I9ccb6453fbebf03d44d3f5b385fa5a49579da873
üst f212aa9f
...@@ -66,7 +66,8 @@ namespace dbaui ...@@ -66,7 +66,8 @@ namespace dbaui
sal_Bool bSaveOnMove; sal_Bool bSaveOnMove;
sal_Bool bReadOnly; sal_Bool bReadOnly;
// Hilfsklasse
// helper class
class ClipboardInvalidator class ClipboardInvalidator
{ {
private: private:
...@@ -98,8 +99,8 @@ namespace dbaui ...@@ -98,8 +99,8 @@ namespace dbaui
virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol); virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol);
virtual void CellModified(); virtual void CellModified();
virtual sal_Bool SaveModified(); // wird aufgerufen vor einem Zellenwechsel virtual sal_Bool SaveModified(); // is called before changing a cell (false prevents change)
// return sal_False, verhindert Zellenwechsel
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
virtual OUString GetCellText(long nRow, sal_uInt16 nColId) const; virtual OUString GetCellText(long nRow, sal_uInt16 nColId) const;
...@@ -132,8 +133,8 @@ namespace dbaui ...@@ -132,8 +133,8 @@ namespace dbaui
sal_Bool SaveCurRow(); sal_Bool SaveCurRow();
void SwitchType( const TOTypeInfoSP& _pType ); void SwitchType( const TOTypeInfoSP& _pType );
/// force displaying of the given row
void DisplayData( long nRow, sal_Bool bGrabFocus = sal_True ); void DisplayData( long nRow, sal_Bool bGrabFocus = sal_True );
// erzwingt das Anzeigen der genannten Zeile (selbst wenn es eigentlich schon die aktuelle ist)
virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ); virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo );
virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rSaveData ); virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rSaveData );
......
...@@ -56,7 +56,7 @@ sal_Bool OTableFieldControl::IsReadOnly() ...@@ -56,7 +56,7 @@ sal_Bool OTableFieldControl::IsReadOnly()
sal_Bool bRead(GetCtrl()->IsReadOnly()); sal_Bool bRead(GetCtrl()->IsReadOnly());
if( !bRead ) if( !bRead )
{ {
// Die Spalten einer ::com::sun::star::sdbcx::View konnen nicht verindert werden // The columns of a ::com::sun::star::sdbcx::View could not be locked
Reference<XPropertySet> xTable = GetCtrl()->GetView()->getController().getTable(); Reference<XPropertySet> xTable = GetCtrl()->GetView()->getController().getTable();
if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == OUString("VIEW")) if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == OUString("VIEW"))
bRead = sal_True; bRead = sal_True;
......
...@@ -57,11 +57,10 @@ typedef ::std::list< DataFlavorEx > DataFlavorEx ...@@ -57,11 +57,10 @@ typedef ::std::list< DataFlavorEx > DataFlavorEx
SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector,
sal_uLong nId ); sal_uLong nId );
// - Vordefinierte Formate - // - predefined formats -
// Do NOT change the order of these values as the implementation depends on them!
// Die Reihenfolge und die Werte d?rfen nicht ge?ndert werden, // stardard formats for that Copy/Paste methods exist
// da die Implementation sich darauf verl??t.
// Standard-Formate fuer die es auch Copy/Paste-Methoden gibt
#define FORMAT_STRING 1 #define FORMAT_STRING 1
#define FORMAT_BITMAP 2 #define FORMAT_BITMAP 2
#define FORMAT_GDIMETAFILE 3 #define FORMAT_GDIMETAFILE 3
...@@ -69,10 +68,10 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec ...@@ -69,10 +68,10 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec
#define FORMAT_FILE 5 #define FORMAT_FILE 5
#define FORMAT_FILE_LIST 6 #define FORMAT_FILE_LIST 6
// Weitere Standardformate (diese gehen nur ueber CopyData/PasteData) // further formats (only via CopyData/PasteData)
#define FORMAT_RTF 10 #define FORMAT_RTF 10
// Source-Options // source options
#define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001) #define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001)
#define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002) #define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002)
#define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004) #define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004)
...@@ -81,7 +80,7 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec ...@@ -81,7 +80,7 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec
#define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F) #define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F)
#define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020) #define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020)
// Aktionen // actions
#define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF) #define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF)
#define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE) #define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE)
#define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE #define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE
...@@ -123,7 +122,7 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec ...@@ -123,7 +122,7 @@ SOT_DLLPUBLIC bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVec
#define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000) #define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000)
#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000) #define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000)
// Ziele // destinations
#define EXCHG_DEST_DOC_OLEOBJ 1 #define EXCHG_DEST_DOC_OLEOBJ 1
#define EXCHG_DEST_CHARTDOC_OLEOBJ 2 #define EXCHG_DEST_CHARTDOC_OLEOBJ 2
#define EXCHG_DEST_DOC_TEXTFRAME 3 #define EXCHG_DEST_DOC_TEXTFRAME 3
...@@ -158,10 +157,8 @@ public: ...@@ -158,10 +157,8 @@ public:
static bool IsInternal( const SvGlobalName& ); static bool IsInternal( const SvGlobalName& );
static sal_uLong GetFormatIdFromMimeType( const OUString& rMimeType ); static sal_uLong GetFormatIdFromMimeType( const OUString& rMimeType );
// bestimme die SotFormatStringId von dem registrierten Format // determine the SotFormatStringId for the registered format
//JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da //FIXME JP 12.11.98: this three methods are obsolete as all ClipboardIds are static and equvialent to the SotFormatStringIds!
// die ClipboardIds statisch sind und aequivalent zur
// SotFormatStringId ist!
static SotFormatStringId GetFormatStringId( sal_uLong nFormat ) static SotFormatStringId GetFormatStringId( sal_uLong nFormat )
{ return nFormat; } { return nFormat; }
static SotFormatStringId GetFormatStringId( const OUString& rName ) static SotFormatStringId GetFormatStringId( const OUString& rName )
...@@ -173,15 +170,15 @@ public: ...@@ -173,15 +170,15 @@ public:
static sal_uInt16 GetExchangeAction( static sal_uInt16 GetExchangeAction(
// XTransferable // XTransferable
const DataFlavorExVector& rDataFlavorExVector, const DataFlavorExVector& rDataFlavorExVector,
// Ziel der Aktion (EXCHG_DEST_*) // destination of an action (EXCHG_DEST_*)
sal_uInt16 nDestination, sal_uInt16 nDestination,
// Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...) // action for a source (EXCHG_SOURCE_...)
sal_uInt16 nSourceOptions, sal_uInt16 nSourceOptions,
// vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) // user action (EXCHG_IN_*, EXCHG_INOUT_*)
sal_uInt16 nUserAction, sal_uInt16 nUserAction,
// In:- Out: Zu benutzendes Format // In:- Out: format to use
sal_uLong& rFormat, sal_uLong& rFormat,
// In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) // In:- Out: default action (EXCHG_IN_*, EXCHG_INOUT_*)
sal_uInt16& rDefaultAction, sal_uInt16& rDefaultAction,
// In:- optional - check only for this specific format // In:- optional - check only for this specific format
sal_uLong nOnlyTestFormat = 0, sal_uLong nOnlyTestFormat = 0,
......
...@@ -545,8 +545,7 @@ void FormattedField::ImplSetTextImpl(const OUString& rNew, Selection* pNewSel) ...@@ -545,8 +545,7 @@ void FormattedField::ImplSetTextImpl(const OUString& rNew, Selection* pNewSel)
SpinField::SetText(rNew, aSel); SpinField::SetText(rNew, aSel);
} }
m_bValueDirty = sal_True; m_bValueDirty = sal_True; // not always necessary, but better re-evaluate for safety reasons
// muss nicht stimmen, aber sicherheitshalber ...
} }
long FormattedField::PreNotify(NotifyEvent& rNEvt) long FormattedField::PreNotify(NotifyEvent& rNEvt)
...@@ -565,14 +564,15 @@ void FormattedField::ImplSetFormatKey(sal_uLong nFormatKey) ...@@ -565,14 +564,15 @@ void FormattedField::ImplSetFormatKey(sal_uLong nFormatKey)
sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0); sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
if (bNeedFormatter) if (bNeedFormatter)
{ {
ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt ImplGetFormatter(); // this creates a standard formatter
// It might happen that the standard formatter makes no sense here, but it takes a default
// format. Thus, it is possible to set one of the other standard keys (which are spanning
// across multiple formatters).
m_nFormatKey = nFormatKey; m_nFormatKey = nFormatKey;
// kann sein, dass das in dem Standard-Formatter keinen Sinn macht, aber der nimmt dann ein Default-Format an. // When calling SetFormatKey without a formatter, the key must be one of the standard values
// Auf diese Weise kann ich einfach einen der - formatteruebergreifended gleichen - Standard-Keys setzen. // that is available for all formatters (and, thus, also in this new one).
DBG_ASSERT(m_pFormatter->GetEntry(nFormatKey) != NULL, "FormattedField::ImplSetFormatKey : invalid format key !"); DBG_ASSERT(m_pFormatter->GetEntry(nFormatKey) != NULL, "FormattedField::ImplSetFormatKey : invalid format key !");
// Wenn SetFormatKey aufgerufen wird, ohne dass ein Formatter existiert, muss der Key einer der Standard-Werte
// sein, der in allen Formattern (also auch in meinem neu angelegten) vorhanden ist.
} }
} }
...@@ -611,11 +611,11 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset ...@@ -611,11 +611,11 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset
sal_uInt32 nDestKey = pFormatter->TestNewString(sOldFormat); sal_uInt32 nDestKey = pFormatter->TestNewString(sOldFormat);
if (nDestKey == NUMBERFORMAT_ENTRY_NOT_FOUND) if (nDestKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
{ {
// die Sprache des neuen Formatters // language of the new formatter
const SvNumberformat* pDefaultEntry = pFormatter->GetEntry(0); const SvNumberformat* pDefaultEntry = pFormatter->GetEntry(0);
LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW; LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW;
// den alten Format-String in die neue Sprache konvertieren // convert the old format string into the new language
sal_Int32 nCheckPos; sal_Int32 nCheckPos;
short nType; short nType;
pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang); pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang);
...@@ -863,7 +863,7 @@ void FormattedField::SetMinValue(double dMin) ...@@ -863,7 +863,7 @@ void FormattedField::SetMinValue(double dMin)
m_dMinValue = dMin; m_dMinValue = dMin;
m_bHasMin = sal_True; m_bHasMin = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue // for checking the current value at the new border -> ImplSetValue
ReFormat(); ReFormat();
} }
...@@ -874,7 +874,7 @@ void FormattedField::SetMaxValue(double dMax) ...@@ -874,7 +874,7 @@ void FormattedField::SetMaxValue(double dMax)
m_dMaxValue = dMax; m_dMaxValue = dMax;
m_bHasMax = sal_True; m_bHasMax = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue // for checking the current value at the new border -> ImplSetValue
ReFormat(); ReFormat();
} }
...@@ -915,10 +915,10 @@ void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) ...@@ -915,10 +915,10 @@ void FormattedField::ImplSetValue(double dVal, sal_Bool bForce)
OUString sNewText; OUString sNewText;
if (ImplGetFormatter()->IsTextFormat(m_nFormatKey)) if (ImplGetFormatter()->IsTextFormat(m_nFormatKey))
{ {
// zuerst die Zahl als String im Standard-Format // first convert the number as string in standard format
OUString sTemp; OUString sTemp;
ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor); ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor);
// dann den String entsprechend dem Text-Format // than encode the string in the corresponding text format
{ {
ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor); ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor);
} }
...@@ -955,13 +955,13 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal) ...@@ -955,13 +955,13 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !"); DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
sal_uInt32 nFormatKey = m_nFormatKey; // IsNumberFormat veraendert den FormatKey ... sal_uInt32 nFormatKey = m_nFormatKey; // IsNumberFormat changes the FormatKey!
if (ImplGetFormatter()->IsTextFormat(nFormatKey) && m_bTreatAsNumber) if (ImplGetFormatter()->IsTextFormat(nFormatKey) && m_bTreatAsNumber)
// damit wir in einem als Text formatierten Feld trotzdem eine Eingabe wie '1,1' erkennen ... // for detection of values like "1,1" in fields that are formated as text
nFormatKey = 0; nFormatKey = 0;
// Sonderbehandlung fuer %-Formatierung // special treatment for percentage formatting
if (ImplGetFormatter()->GetType(m_nFormatKey) == NUMBERFORMAT_PERCENT) if (ImplGetFormatter()->GetType(m_nFormatKey) == NUMBERFORMAT_PERCENT)
{ {
// the language of our format // the language of our format
...@@ -973,8 +973,7 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal) ...@@ -973,8 +973,7 @@ sal_Bool FormattedField::ImplGetValue(double& dNewVal)
double dTemp; double dTemp;
if (m_pFormatter->IsNumberFormat(sText, nTempFormat, dTemp) && if (m_pFormatter->IsNumberFormat(sText, nTempFormat, dTemp) &&
NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat)) NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat))
// der String entspricht einer Number-Formatierung, hat also nur kein % // the string is equivalent to a number formatted one (has no % sign) -> append it
// -> append it
sText += "%"; sText += "%";
// (with this, a input of '3' becomes '3%', which then by the formatter is translated // (with this, a input of '3' becomes '3%', which then by the formatter is translated
// into 0.03. Without this, the formatter would give us the double 3 for an input '3', // into 0.03. Without this, the formatter would give us the double 3 for an input '3',
...@@ -1015,8 +1014,8 @@ double FormattedField::GetValue() ...@@ -1015,8 +1014,8 @@ double FormattedField::GetValue()
void FormattedField::Up() void FormattedField::Up()
{ {
DBG_CHKTHIS(FormattedField, NULL); DBG_CHKTHIS(FormattedField, NULL);
// setValue handles under- and overflows (min/max) automatically
SetValue(GetValue() + m_dSpinSize); SetValue(GetValue() + m_dSpinSize);
// das setValue handelt Bereichsueberschreitungen (min/max) automatisch
SetModifyFlag(); SetModifyFlag();
Modify(); Modify();
......
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef _PARCSS1_HXX #ifndef _PARCSS1_HXX
#define _PARCSS1_HXX #define _PARCSS1_HXX
// Die Tokens des CSS1-Parsers // tokens of the CSS1 parser
enum CSS1Token enum CSS1Token
{ {
CSS1_NULL, CSS1_NULL,
...@@ -30,8 +30,8 @@ enum CSS1Token ...@@ -30,8 +30,8 @@ enum CSS1Token
CSS1_STRING, CSS1_STRING,
CSS1_NUMBER, CSS1_NUMBER,
CSS1_PERCENTAGE, CSS1_PERCENTAGE,
CSS1_LENGTH, // eine absolute Groesse in 1/100 MM CSS1_LENGTH, // absolute length in 1/100 MM
CSS1_PIXLENGTH, // eine Pixel-Groesse CSS1_PIXLENGTH, // length in pixels
CSS1_EMS, CSS1_EMS,
CSS1_EMX, CSS1_EMX,
CSS1_HEXCOLOR, CSS1_HEXCOLOR,
...@@ -57,7 +57,6 @@ enum CSS1Token ...@@ -57,7 +57,6 @@ enum CSS1Token
CSS1_RGB CSS1_RGB
}; };
// die Zustaende des Parsers
enum CSS1ParserState enum CSS1ParserState
{ {
CSS1_PAR_ACCEPTED = 0, CSS1_PAR_ACCEPTED = 0,
...@@ -75,21 +74,22 @@ enum CSS1SelectorType ...@@ -75,21 +74,22 @@ enum CSS1SelectorType
CSS1_SELTYPE_PAGE // Feature: PrintExt CSS1_SELTYPE_PAGE // Feature: PrintExt
}; };
// Die folegende Klasse beschreibt einen Simple-Selector, also /** A simple selector
// - einen HTML-Element-Namen *
// - einen HTML-Element-Namen mit Klasse (durch '.' getrennt) * This class represents a simple selector, e.g.
// - eine Klasse (ohne Punkt) * - a HTML element name
// - eine mit ID=xxx gesetzte ID aus einem HTML-Dokument * - a HTML element name with a class (separated by a dot)
// oder * - a class (without a dot)
// - ein Pseudo-Element * - an ID (set with ID=xxx)
// * - a pseudo element
// Die Simple-Sektoren werden in einer Liste zu vollstaendigen *
// Selektoren verkettet * These simple selectors are chained in a list to complete selectors
*/
class CSS1Selector class CSS1Selector
{ {
CSS1SelectorType eType; // Art des Selektors CSS1SelectorType eType; // the type
OUString aSelector; // der Selektor selbst OUString aSelector; // the selector itself
CSS1Selector *pNext; // die naechste Komponente CSS1Selector *pNext; // the following component
public: public:
CSS1Selector( CSS1SelectorType eTyp, const OUString &rSel ) CSS1Selector( CSS1SelectorType eTyp, const OUString &rSel )
...@@ -105,22 +105,20 @@ public: ...@@ -105,22 +105,20 @@ public:
const CSS1Selector *GetNext() const { return pNext; } const CSS1Selector *GetNext() const { return pNext; }
}; };
// Die folegende Klasse beschreibt einen Teil-Ausdruck einer /** a subexpression of a CSS1 declaration
// CSS1-Deklaration sie besteht aus *
// * It contains
// - dem Typ des Ausdrucks (entspricht dem Token) * - the type of this expression (= token)
// - dem eigentlichen Wert als String und ggf. double * - the value as string (and/or double, with algebraic sign for NUMBER and LENGTH)
// der double-Wert enthaelt das Vorzeichen fuer NUMBER und LENGTH * - the operator with that it is connected with the *predecessor* expression
// - und dem Operator, mit dem er mit dem *Vorganger*-Ausdruck */
// verknuepft ist.
//
struct CSS1Expression struct CSS1Expression
{ {
sal_Unicode cOp; // Art der Verkuepfung mit dem Vorgaenger sal_Unicode cOp; // type of the link with its predecessor
CSS1Token eType; // der Typ des Wertes CSS1Token eType; // type of the expression
OUString aValue; // und sein Wert als String OUString aValue; // value as string
double nValue; // und als Zahl (TWIPs fuer LENGTH) double nValue; // value as number (TWIPs for LENGTH)
CSS1Expression *pNext; // die naechste Komponente CSS1Expression *pNext; // the following component
public: public:
CSS1Expression( CSS1Token eTyp, const OUString &rVal, CSS1Expression( CSS1Token eTyp, const OUString &rVal,
...@@ -163,58 +161,58 @@ inline sal_Int32 CSS1Expression::GetSLength() const ...@@ -163,58 +161,58 @@ inline sal_Int32 CSS1Expression::GetSLength() const
return (sal_Int32)(nValue + (nValue < 0. ? -.5 : .5 )); return (sal_Int32)(nValue + (nValue < 0. ? -.5 : .5 ));
} }
// Diese Klasse parst den Inhalt eines Style-Elements oder eine Style-Option /** Parser of a style element/option
// und bereitet ihn ein wenig auf. *
// * This class parses the content of a style element or a style option and preprocesses it.
// Das Ergebnis des Parsers wird durch die Mehtoden SelectorParsed() *
// und DeclarationParsed() an abgeleitete Parser uebergeben. Bsp: * The result of the parser is forwarded to derived parsers by the methods SelectorParsed()
// * and DeclarationParsed(). Example:
// H1, H2 { font-weight: bold; text-align: right } * H1, H2 { font-weight: bold; text-align: right }
// | | | | * | | | |
// | | | DeclP( 'text-align', 'right' ) * | | | DeclP( 'text-align', 'right' )
// | | DeclP( 'font-weight', 'bold' ) * | | DeclP( 'font-weight', 'bold' )
// | SelP( 'H2', sal_False ) * | SelP( 'H2', sal_False )
// SelP( 'H1', sal_True ) * SelP( 'H1', sal_True )
// */
class CSS1Parser class CSS1Parser
{ {
sal_Bool bWhiteSpace : 1; // White-Space gelesen? sal_Bool bWhiteSpace : 1; // read a whitespace?
sal_Bool bEOF : 1; // Ende des "Files" ? sal_Bool bEOF : 1; // is end of "file"?
sal_Unicode cNextCh; // naechstes Zeichen sal_Unicode cNextCh; // next character
sal_Int32 nInPos; // aktuelle Position im Input-String sal_Int32 nInPos; // current position in the input string
sal_uInt32 nlLineNr; // akt. Zeilen Nummer sal_uInt32 nlLineNr; // current row number
sal_uInt32 nlLinePos; // akt. Spalten Nummer sal_uInt32 nlLinePos; // current column number
double nValue; // der Wert des Tokens als Zahl double nValue; // value of the token as number
CSS1ParserState eState; // der akteulle Zustand der Parsers CSS1ParserState eState; // current state of the parser
CSS1Token nToken; // das aktuelle Token CSS1Token nToken; // the current token
OUString aIn; // der zu parsende String OUString aIn; // the string to parse
OUString aToken; // das Token als String OUString aToken; // token as string
// Parsen vorbereiten /// prepare parsing
void InitRead( const OUString& rIn ); void InitRead( const OUString& rIn );
// das naechste Zeichen holen /// @returns the next character to parse
sal_Unicode GetNextChar(); sal_Unicode GetNextChar();
// das naechste Token holen /// @returns the next token to parse
CSS1Token GetNextToken(); CSS1Token GetNextToken();
// arbeitet der Parser noch? /// Is the parser still working?
sal_Bool IsParserWorking() const { return CSS1_PAR_WORKING == eState; } sal_Bool IsParserWorking() const { return CSS1_PAR_WORKING == eState; }
sal_Bool IsEOF() const { return bEOF; } sal_Bool IsEOF() const { return bEOF; }
sal_uInt32 IncLineNr() { return ++nlLineNr; } sal_uInt32 IncLineNr() { return ++nlLineNr; }
sal_uInt32 IncLinePos() { return ++nlLinePos; } sal_uInt32 IncLinePos() { return ++nlLinePos; }
inline sal_uInt32 SetLinePos( sal_uInt32 nlPos ); // inline unten inline sal_uInt32 SetLinePos( sal_uInt32 nlPos ); // inline declaration below
// Parsen von Teilen der Grammatik // parse parts of the grammar
void ParseRule(); void ParseRule();
CSS1Selector *ParseSelector(); CSS1Selector *ParseSelector();
CSS1Expression *ParseDeclaration( OUString& rProperty ); CSS1Expression *ParseDeclaration( OUString& rProperty );
...@@ -222,25 +220,40 @@ class CSS1Parser ...@@ -222,25 +220,40 @@ class CSS1Parser
protected: protected:
void ParseStyleSheet(); void ParseStyleSheet();
// Den Inhalt eines HTML-Style-Elements parsen. /** parse the content of a HTML style element
// Fuer jeden Selektor und jede Deklaration wird *
// SelectorParsed() bzw. DeclarationParsed() aufgerufen. * For each selector and each declaration the methods SelectorParsed()
* or DeclarationParsed() need to be called afterwards
*
* @param rIn the style element as string
* @return true if ???
*/
sal_Bool ParseStyleSheet( const OUString& rIn ); sal_Bool ParseStyleSheet( const OUString& rIn );
// Den Inhalt einer HTML-Style-Option parsen. /** parse the content of a HTML style option
// Fuer jede Deklaration wird DeclarationParsed() aufgerufen. *
* For each selector and each declaration the methods SelectorParsed()
* or DeclarationParsed() need to be called afterwards.
*
* @param rIn the style option as string
* @return true if ???
*/
sal_Bool ParseStyleOption( const OUString& rIn ); sal_Bool ParseStyleOption( const OUString& rIn );
// Diese Methode wird aufgerufen, wenn ein Selektor geparsed wurde /** Called after a selector was parsed.
// Wenn 'bFirst' gesetzt ist, beginnt mit dem Selektor eine neue *
// Deklaration. Wird sal_True zurueckgegeben, wird der Selektor * @param pSelector The selector that was parsed
// geloscht, sonst nicht. * @param bFirst if true, a new declaration starts with this selector
// Die Implementierung dieser Methode gibt nur sal_True zuruck. * @return If true, the selector will be deleted. (Returns always true?)
*/
virtual bool SelectorParsed( CSS1Selector* pSelector, bool bFirst ); virtual bool SelectorParsed( CSS1Selector* pSelector, bool bFirst );
// Diese Methode wird fuer jede geparsete Property aufgerufen. Wird /** Called after a declaration or property was parsed
// sal_True zurueckgegeben wird der Selektor geloscht, sonst nicht. *
// Die Implementierung dieser Methode gibt nur sal_True zuruck. * @param rProperty The declaration/property
* @param pExpr ???
* @return If true, the declaration will be deleted. (Returns always true?)
*/
virtual sal_Bool DeclarationParsed( const OUString& rProperty, virtual sal_Bool DeclarationParsed( const OUString& rProperty,
const CSS1Expression *pExpr ); const CSS1Expression *pExpr );
......
...@@ -1331,7 +1331,7 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) ...@@ -1331,7 +1331,7 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
do do
{ {
// Messages verarbeiten // process messages
MSG aMsg; MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) ) if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment