Lines 1520-1525
Link Here
|
1520 |
|
1520 |
|
1521 |
if( 85 == pF->nId ) |
1521 |
if( 85 == pF->nId ) |
1522 |
{ |
1522 |
{ |
|
|
1523 |
String aDocProperty; |
1524 |
_ReadFieldParams aReadParam( rStr ); |
1525 |
long nRet; |
1526 |
while( -1 != ( nRet = aReadParam.SkipToNextToken() )) |
1527 |
{ |
1528 |
switch( nRet ) |
1529 |
{ |
1530 |
case -2: |
1531 |
if( !aDocProperty.Len() ) |
1532 |
aDocProperty = aReadParam.GetResult(); |
1533 |
break; |
1534 |
case '*': |
1535 |
//Skip over MERGEFORMAT |
1536 |
aReadParam.SkipToNextToken(); |
1537 |
break; |
1538 |
} |
1539 |
} |
1540 |
aDocProperty.EraseAllChars('"'); |
1541 |
|
1523 |
/* |
1542 |
/* |
1524 |
There are up to 26 fields that may be meant by 'DocumentProperty'. |
1543 |
There are up to 26 fields that may be meant by 'DocumentProperty'. |
1525 |
Which of them is to be inserted here ? |
1544 |
Which of them is to be inserted here ? |
Lines 1527-1637
Link Here
|
1527 |
method that compares the given Parameter String with the four |
1546 |
method that compares the given Parameter String with the four |
1528 |
possible name sets (english, german, french, spanish) |
1547 |
possible name sets (english, german, french, spanish) |
1529 |
*/ |
1548 |
*/ |
1530 |
String aStr( rStr ); |
|
|
1531 |
xub_StrLen nPos1 = aStr.Search( '"' ); |
1532 |
if( (STRING_NOTFOUND != nPos1) && (nPos1+1 < aStr.Len()) ) |
1533 |
{ |
1534 |
xub_StrLen nPos2 = aStr.SearchAndReplace( '"', '\0', nPos1+1 ); |
1535 |
if (STRING_NOTFOUND != nPos2) |
1536 |
{ |
1537 |
aStr.Erase(0, nPos1+1); |
1538 |
static const sal_Char* aName10 = "\x0F"; // SW field code |
1539 |
static const sal_Char* aName11 // German |
1540 |
= "TITEL"; |
1541 |
static const sal_Char* aName12 // French |
1542 |
= "TITRE"; |
1543 |
static const sal_Char* aName13 // English |
1544 |
= "TITLE"; |
1545 |
static const sal_Char* aName14 // Spanish |
1546 |
= "TITRO"; |
1547 |
static const sal_Char* aName20 = "\x15"; // SW filed code |
1548 |
static const sal_Char* aName21 // German |
1549 |
= "ERSTELLDATUM"; |
1550 |
static const sal_Char* aName22 // French |
1551 |
= "CR\xC9\xC9"; |
1552 |
static const sal_Char* aName23 // English |
1553 |
= "CREATED"; |
1554 |
static const sal_Char* aName24 // Spanish |
1555 |
= "CREADO"; |
1556 |
static const sal_Char* aName30 = "\x16"; // SW filed code |
1557 |
static const sal_Char* aName31 // German |
1558 |
= "ZULETZTGESPEICHERTZEIT"; |
1559 |
static const sal_Char* aName32 // French |
1560 |
= "DERNIERENREGISTREMENT"; |
1561 |
static const sal_Char* aName33 // English |
1562 |
= "SAVED"; |
1563 |
static const sal_Char* aName34 // Spanish |
1564 |
= "MODIFICADO"; |
1565 |
static const sal_Char* aName40 = "\x17"; // SW filed code |
1566 |
static const sal_Char* aName41 // German |
1567 |
= "ZULETZTGEDRUCKT"; |
1568 |
static const sal_Char* aName42 // French |
1569 |
= "DERNI\xC8" "REIMPRESSION"; |
1570 |
static const sal_Char* aName43 // English |
1571 |
= "LASTPRINTED"; |
1572 |
static const sal_Char* aName44 // Spanish |
1573 |
= "HUPS PUPS"; |
1574 |
static const sal_Char* aName50 = "\x18"; // SW filed code |
1575 |
static const sal_Char* aName51 // German |
1576 |
= "\xDC" "BERARBEITUNGSNUMMER"; |
1577 |
static const sal_Char* aName52 // French |
1578 |
= "NUM\xC9" "RODEREVISION"; |
1579 |
static const sal_Char* aName53 // English |
1580 |
= "REVISIONNUMBER"; |
1581 |
static const sal_Char* aName54 // Spanish |
1582 |
= "SNUBBEL BUBBEL"; |
1583 |
static const USHORT nFldCnt = 5; |
1584 |
|
1549 |
|
1585 |
// additional fields are to be coded soon! :-) |
1550 |
static const sal_Char* aName10 = "\x0F"; // SW field code |
|
|
1551 |
static const sal_Char* aName11 // German |
1552 |
= "TITEL"; |
1553 |
static const sal_Char* aName12 // French |
1554 |
= "TITRE"; |
1555 |
static const sal_Char* aName13 // English |
1556 |
= "TITLE"; |
1557 |
static const sal_Char* aName14 // Spanish |
1558 |
= "TITRO"; |
1559 |
static const sal_Char* aName20 = "\x15"; // SW filed code |
1560 |
static const sal_Char* aName21 // German |
1561 |
= "ERSTELLDATUM"; |
1562 |
static const sal_Char* aName22 // French |
1563 |
= "CR\xC9\xC9"; |
1564 |
static const sal_Char* aName23 // English |
1565 |
= "CREATED"; |
1566 |
static const sal_Char* aName24 // Spanish |
1567 |
= "CREADO"; |
1568 |
static const sal_Char* aName30 = "\x16"; // SW filed code |
1569 |
static const sal_Char* aName31 // German |
1570 |
= "ZULETZTGESPEICHERTZEIT"; |
1571 |
static const sal_Char* aName32 // French |
1572 |
= "DERNIERENREGISTREMENT"; |
1573 |
static const sal_Char* aName33 // English |
1574 |
= "SAVED"; |
1575 |
static const sal_Char* aName34 // Spanish |
1576 |
= "MODIFICADO"; |
1577 |
static const sal_Char* aName40 = "\x17"; // SW filed code |
1578 |
static const sal_Char* aName41 // German |
1579 |
= "ZULETZTGEDRUCKT"; |
1580 |
static const sal_Char* aName42 // French |
1581 |
= "DERNI\xC8" "REIMPRESSION"; |
1582 |
static const sal_Char* aName43 // English |
1583 |
= "LASTPRINTED"; |
1584 |
static const sal_Char* aName44 // Spanish |
1585 |
= "HUPS PUPS"; |
1586 |
static const sal_Char* aName50 = "\x18"; // SW filed code |
1587 |
static const sal_Char* aName51 // German |
1588 |
= "\xDC" "BERARBEITUNGSNUMMER"; |
1589 |
static const sal_Char* aName52 // French |
1590 |
= "NUM\xC9" "RODEREVISION"; |
1591 |
static const sal_Char* aName53 // English |
1592 |
= "REVISIONNUMBER"; |
1593 |
static const sal_Char* aName54 // Spanish |
1594 |
= "SNUBBEL BUBBEL"; |
1595 |
static const USHORT nFldCnt = 5; |
1586 |
|
1596 |
|
1587 |
static const USHORT nLangCnt = 4; |
1597 |
// additional fields are to be coded soon! :-) |
1588 |
static const sal_Char *aNameSet_26[nFldCnt][nLangCnt+1] = |
|
|
1589 |
{ |
1590 |
{aName10, aName11, aName12, aName13, aName14}, |
1591 |
{aName20, aName21, aName22, aName23, aName24}, |
1592 |
{aName30, aName31, aName32, aName33, aName34}, |
1593 |
{aName40, aName41, aName42, aName43, aName44}, |
1594 |
{aName50, aName51, aName52, aName53, aName54} |
1595 |
}; |
1596 |
bool bFldFound= false; |
1597 |
USHORT nFIdx; |
1598 |
for(USHORT nLIdx=1; !bFldFound && (nLangCnt > nLIdx); ++nLIdx) |
1599 |
{ |
1600 |
for(nFIdx = 0; !bFldFound && (nFldCnt > nFIdx); ++nFIdx) |
1601 |
{ |
1602 |
if( aStr.Equals( String( aNameSet_26[nFIdx][nLIdx], |
1603 |
RTL_TEXTENCODING_MS_1252 ) ) ) |
1604 |
{ |
1605 |
bFldFound = true; |
1606 |
pF->nId = aNameSet_26[nFIdx][0][0]; |
1607 |
} |
1608 |
} |
1609 |
} |
1610 |
if( !bFldFound ) |
1611 |
return FLD_TEXT; // Error: give up |
1612 |
} |
1613 |
} |
1614 |
else |
1615 |
{ |
1616 |
// MM Create a user field |
1617 |
String aDocProperty; |
1618 |
_ReadFieldParams aReadParam( aStr ); |
1619 |
long nRet; |
1620 |
while( -1 != ( nRet = aReadParam.SkipToNextToken() )) |
1621 |
{ |
1622 |
switch( nRet ) |
1623 |
{ |
1624 |
case -2: |
1625 |
if( !aDocProperty.Len() ) |
1626 |
aDocProperty = aReadParam.GetResult(); |
1627 |
break; |
1628 |
case '*': |
1629 |
//Skip over MERGEFORMAT |
1630 |
aReadParam.SkipToNextToken(); |
1631 |
break; |
1632 |
} |
1633 |
} |
1634 |
|
1598 |
|
|
|
1599 |
static const USHORT nLangCnt = 4; |
1600 |
static const sal_Char *aNameSet_26[nFldCnt][nLangCnt+1] = |
1601 |
{ |
1602 |
{aName10, aName11, aName12, aName13, aName14}, |
1603 |
{aName20, aName21, aName22, aName23, aName24}, |
1604 |
{aName30, aName31, aName32, aName33, aName34}, |
1605 |
{aName40, aName41, aName42, aName43, aName44}, |
1606 |
{aName50, aName51, aName52, aName53, aName54} |
1607 |
}; |
1608 |
|
1609 |
bool bFldFound= false; |
1610 |
USHORT nFIdx; |
1611 |
for(USHORT nLIdx=1; !bFldFound && (nLangCnt > nLIdx); ++nLIdx) |
1612 |
{ |
1613 |
for(nFIdx = 0; !bFldFound && (nFldCnt > nFIdx); ++nFIdx) |
1614 |
{ |
1615 |
if( aDocProperty.Equals( String( aNameSet_26[nFIdx][nLIdx], |
1616 |
RTL_TEXTENCODING_MS_1252 ) ) ) |
1617 |
{ |
1618 |
bFldFound = true; |
1619 |
pF->nId = aNameSet_26[nFIdx][0][0]; |
1620 |
} |
1621 |
} |
1622 |
} |
1623 |
|
1624 |
if( !bFldFound ) |
1625 |
{ |
1635 |
SwUserFieldType aTmp( &rDoc, aDocProperty ); |
1626 |
SwUserFieldType aTmp( &rDoc, aDocProperty ); |
1636 |
aTmp.SetContent(GetFieldResult( pF )); |
1627 |
aTmp.SetContent(GetFieldResult( pF )); |
1637 |
SwUserField aUFld( (SwUserFieldType*)rDoc.InsertFldType( aTmp )); |
1628 |
SwUserField aUFld( (SwUserFieldType*)rDoc.InsertFldType( aTmp )); |