Hi Eike,

Eike Rathke skrev:
If you want to go the hard way and need a configuration entry to be able
to control the behavior by some other means, I suggest you add a new
node and property to the Office.Calc/Misc options instead,
registry/data/org/openoffice/Office/Calc.xcu, and read it by means of
the Calc application options. See sc/source/core/tool/appoptio.cxx and
add your node and property as SCMISCOPT_YOUROPTION at CFGPATH_MISC
behind SCMISCOPT_DEFOBJHEIGHT, adjust SCMISCOPT_COUNT, add the property
name to ScAppCfg::GetMiscPropertyNames(), add reading the property to
ScAppCfg::ScAppCfg() after SCMISCOPT_DEFOBJHEIGHT. If you want to be
able to write the property add it to IMPL_LINK( ScAppCfg, MiscCommitHdl, ...)

In sc/inc/appoptio.hxx add GetYourOption() and SetYourOption() methods
to class ScAppOptions and use them in ScAppCfg::ScAppCfg() and
ScAppCfg::MiscCommitHdl(). You may then access the configuration value
in sc/source/filter/rtf/eeimpars.cxx by calling
SC_MOD()->GetAppOptions().GetYourOption()

Many thanks for your easy to follow instructions. I have done as
suggested. Patches attached. Comments are most welcome.

Søren

RCS file: /cvs/sc/sc/inc/appoptio.hxx,v
retrieving revision 1.5
diff -u -r1.5 appoptio.hxx
--- appoptio.hxx        23 Aug 2004 09:22:17 -0000      1.5
+++ appoptio.hxx        8 Sep 2005 16:35:00 -0000
@@ -128,6 +128,8 @@
        INT32           GetDefaultObjectSizeWidth() const               { 
return nDefaultObjectSizeWidth; }
        void            SetDefaultObjectSizeHeight(INT32 nNew)  { 
nDefaultObjectSizeHeight = nNew; }
        INT32           GetDefaultObjectSizeHeight() const              { 
return nDefaultObjectSizeHeight; }
+       void            SetNumberRecognitionAssumeEnglish( BOOL bNew )  { 
bNumberRecognitionAssumeEnglish = bNew; }
+       BOOL            GetNumberRecognitionAssumeEnglish() const               
{ return bNumberRecognitionAssumeEnglish; }
 
 
        const ScAppOptions&     operator=       ( const ScAppOptions& rOpt );
RCS file: /cvs/sc/sc/source/core/tool/appoptio.cxx,v
retrieving revision 1.4
diff -u -r1.4 appoptio.cxx
--- appoptio.cxx        26 Mar 2002 17:17:33 -0000      1.4
+++ appoptio.cxx        8 Sep 2005 16:32:28 -0000
@@ -423,7 +423,8 @@
 
 #define SCMISCOPT_DEFOBJWIDTH          0
 #define SCMISCOPT_DEFOBJHEIGHT         1
-#define SCMISCOPT_COUNT                                2
+#define SCMISCOPT_ENGLISHNUMS                  2
+#define SCMISCOPT_COUNT                                3
 
 
 Sequence<OUString> ScAppCfg::GetLayoutPropertyNames()
@@ -512,8 +513,9 @@
 {
        static const char* aPropNames[] =
        {
-               "DefaultObjectSize/Width",      // SCMISCOPT_DEFOBJWIDTH
-               "DefaultObjectSize/Height"      // SCMISCOPT_DEFOBJHEIGHT
+               "DefaultObjectSize/Width",              // SCMISCOPT_DEFOBJWIDTH
+               "DefaultObjectSize/Height",             // 
SCMISCOPT_DEFOBJHEIGHT
+               "NumberRecognition/AssumeEnglish"       // SCMISCOPT_ENGLISHNUMS
        };
        Sequence<OUString> aNames(SCMISCOPT_COUNT);
        OUString* pNames = aNames.getArray();
@@ -697,6 +699,9 @@
                                        case SCMISCOPT_DEFOBJHEIGHT:
                                                if (pValues[nProp] >>= nIntVal) 
SetDefaultObjectSizeHeight( nIntVal );
                                                break;
+                                       case SCMISCOPT_ENGLISHNUMS:
+                                               
SetNumberRecognitionAssumeEnglish( ScUnoHelpFunctions::GetBoolFromAny( 
pValues[nProp] ) );
+                                               break;
                                }
                        }
                }
@@ -855,6 +860,9 @@
                                break;
                        case SCMISCOPT_DEFOBJHEIGHT:
                                pValues[nProp] <<= (sal_Int32) 
GetDefaultObjectSizeHeight();
+                               break;
+                       case SCMISCOPT_ENGLISHNUMS:
+                               ScUnoHelpFunctions::SetBoolInAny( 
pValues[nProp], GetNumberRecognitionAssumeEnglish() );
                                break;
                }
        }
        
RCS file: /cvs/util/officecfg/registry/schema/org/openoffice/Office/Calc.xcs,v
retrieving revision 1.18
diff -u -r1.18 Calc.xcs
--- Calc.xcs    8 Sep 2005 15:11:21 -0000       1.18
+++ Calc.xcs    8 Sep 2005 16:24:54 -0000
@@ -1336,6 +1336,19 @@
                                        <value>5000</value>
                                </prop>
                        </group>
+                       <group oor:name="NumberRecognition">
+                               <info>
+                                       <desc>Contains setting for number 
recognition.</desc>
+                               </info>
+                               <prop oor:name="AssumeEnglish" 
oor:type="xs:boolean">
+                                       <info>
+                                               <desc>Specifies whether 
imported or pasted numbers are recognized as English before current locale. 
E.g. 1.000 is always recognized as 1 when setting is true.</desc>
+                                               <label>Assume English 
Numbers</label>
+                                       </info>
+                                       <value>true</value>
+                               </prop>
+                       </group>
+
                </group>
        </component>
 </oor:component-schema>
RCS file: /cvs/sc/sc/source/filter/rtf/eeimpars.cxx,v
retrieving revision 1.12
diff -u -r1.12 eeimpars.cxx
--- eeimpars.cxx        11 Jan 2005 13:18:53 -0000      1.12
+++ eeimpars.cxx        8 Sep 2005 16:48:38 -0000
@@ -386,7 +386,13 @@
                     }
                                        const sal_Unicode cDecSepEng = '.';
                                        const sal_Unicode cThoSepEng = ',';
-                                       if ( cDecSep != cDecSepEng
+                                       
+                                       // Check option in 
user/registry/data/org/openoffice/Office/Calc.xcu and disable assumption that 
HTML and RTF is en_US if false: Workaround for issue 50670, issue 39898, issue 
38494
+                                       bool bAssumeEnglishNumbers = TRUE;
+                   
+                                       bAssumeEnglishNumbers = 
SC_MOD()->GetAppOptions().GetNumberRecognitionAssumeEnglish()
+                   
+                                       if ( bAssumeEnglishNumbers && cDecSep 
!= cDecSepEng
                                          && aStr.GetTokenCount( cDecSepEng ) 
== 2 )
                                        {       // evtl. englische Zahl wandeln 
und im Deutschen
                                                // den Numberformatter kein 
Datum draus machen lassen..

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to