Re: Need help with strings

2015-04-09 Thread Ariel Constenla-Haile
Hello Regina,

On Wed, Apr 08, 2015 at 09:02:06PM +0200, Regina Henschel wrote:
 Hi all,
 
 I'm going to improve the MathML type detection. Currently there exist files,
 that can be opened or imported fine, when the type detection would allow it.
 https://bz.apache.org/ooo/show_bug.cgi?id=126230
 
 I have attached a C++ file to show what I want to do.
 The problem is, that MathML does not need to be encoded in utf-8 but can
 have any other encoding. For example MS Windows Math Input Control exports
 formulas in utf-16.
 
 So my question is, which kind of string can I use, that is able to
 detect/use utf-16 and has the needed methods similar to C++ string methods
 find, rfind, insert, substring, clear, erase? Does AOO has such kind of
 string?

You can use OpenOffice's rtl string and string buffer classes, together
with the lower lever text conversion from
https://www.openoffice.org/api/docs/cpp/ref/names/o-textcvt.h.html

 It is possible to get the encoding from the MathML file or set default
 utf-8, in case that information is needed for to instantiate a string
 object.

If the file has no information about its encoding, you will have to
perform some kind of encoding detection, see Writer's ASCII filter for
example:

bool SwIoSystem::IsDetectableText
main/sw/source/filter/basflt/iodetect.cxx

used in sal_uLong SwASCIIParser::ReadChars()
main/sw/source/filter/ascii/parasc.cxx

Searching rtl_convertTextToUnicode in OpenGrok might give other useful
hints.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature


Re: Need help with strings

2015-04-09 Thread Regina Henschel

Hi Dennis,

Dennis E. Hamilton schrieb:

Hi!

You are digging into my favorite subject.


We talked about your interest, but with my small spare time, my progress 
is slow.




I am assuming you are talking about strings within the MathML and that it is in 
some form of XML. In that case:

If it is XML, the encoding can be specified in the ? ... ? XML prologue.  
Sniffing for this prologue will determine such things as whether UTF8 or UTF16, and 
big-endian or little-endian.  If single-byte, that will usually mean some kind of 
code page which has a subset of ASCII as a common subset of a larger encoding, such 
as Western European.  In that case, one can read the content of the prefix to see 
what it says, because it should be in a simple, pure ASCII form.  Even if it is a 
double-byte character encoding, such as Shift-JIS, the prologue only needs the 
single-byte portions that are the same as ASCII.




MathML is XML. But because formulas are seldom used as stand-alone 
files, when users e.g. copypaste a formula from a website, they get not 
a complete file but only a fragment. Such fragments can be used via 
Tools  Import Formula in module Math. That had worked in OO1.1.5, 
(where users need to choose the filter themselves) and it works in LO, 
but currently fails in AOO.



The default, however, depends on the MIME type of the XML file.  Text/xml and 
application/xml have different defaults.  Also, MIME types can have parameters 
that specify character sets.


If no BOM and no encoding is given, UTF-8 can be assumed. (I would need 
to search for the correct reference for MathML 2, but see 
http://www.w3.org/TR/2009/WD-MathML3-20090604/chapter6.html#world-int-transf-flavors, 
last sentence.)




The way Windows manages this also includes using a Unicode prefix on UTF8 
(big-endian, I think).  These are not uniformly used across platforms.


Not even unique for MS applications. The Math Input Control produces 
UTF-16 and Word produces UTF-8. The parser can handle both. I have 
tested it already.




Internally, because ODF and AOO are Unicode based, it is necessary to translate 
all arriving text into Unicode for internal storage and use by the application. 
 To do otherwise, lies madness.  There are difficulties with this, because 
Unicode allows local specializations. This comes up in craziness around Symbol 
fonts that do not have common Unicode correspondence.  (Bullets in AOO have 
this disease.)


There is no problem in this aspect. I only need to examine the input 
stream, whether it can be used with the smath-filter.




I have probably provided more information than you require.  I love this 
subject.


Me too.



I have not looked at your code.


No need to spent your time on it now. I have attached it only to show 
what kind of methods I need.


Kind regards
Regina



  - Dennis

PS: The default representation of XML inside OOXML is UTF16 as I recall.  I 
could be mistaken.

-Original Message-
From: Regina Henschel [mailto:rb.hensc...@t-online.de]
Sent: Wednesday, April 8, 2015 12:02
To: AOO dev
Subject: Need help with strings

Hi all,

I'm going to improve the MathML type detection. Currently there exist
files, that can be opened or imported fine, when the type detection
would allow it. https://bz.apache.org/ooo/show_bug.cgi?id=126230

I have attached a C++ file to show what I want to do.
The problem is, that MathML does not need to be encoded in utf-8 but can
have any other encoding. For example MS Windows Math Input Control
exports formulas in utf-16.

So my question is, which kind of string can I use, that is able to
detect/use utf-16 and has the needed methods similar to C++ string
methods find, rfind, insert, substring, clear, erase? Does AOO has such
kind of string?

It is possible to get the encoding from the MathML file or set default
utf-8, in case that information is needed for to instantiate a string
object.

Kind regards
Regina





-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org



Re: Need help with strings

2015-04-09 Thread Regina Henschel

Hi Ariel,

thanks for your hints. It seems that the class OUString has the needed 
methods. But I need some time to test it.


Kind regards
Regina

Ariel Constenla-Haile schrieb:

Hello Regina,

On Wed, Apr 08, 2015 at 09:02:06PM +0200, Regina Henschel wrote:

Hi all,

I'm going to improve the MathML type detection. Currently there exist files,
that can be opened or imported fine, when the type detection would allow it.
https://bz.apache.org/ooo/show_bug.cgi?id=126230

I have attached a C++ file to show what I want to do.
The problem is, that MathML does not need to be encoded in utf-8 but can
have any other encoding. For example MS Windows Math Input Control exports
formulas in utf-16.

So my question is, which kind of string can I use, that is able to
detect/use utf-16 and has the needed methods similar to C++ string methods
find, rfind, insert, substring, clear, erase? Does AOO has such kind of
string?


You can use OpenOffice's rtl string and string buffer classes, together
with the lower lever text conversion from
https://www.openoffice.org/api/docs/cpp/ref/names/o-textcvt.h.html


It is possible to get the encoding from the MathML file or set default
utf-8, in case that information is needed for to instantiate a string
object.


If the file has no information about its encoding, you will have to
perform some kind of encoding detection, see Writer's ASCII filter for
example:

bool SwIoSystem::IsDetectableText
main/sw/source/filter/basflt/iodetect.cxx

used in sal_uLong SwASCIIParser::ReadChars()
main/sw/source/filter/ascii/parasc.cxx

Searching rtl_convertTextToUnicode in OpenGrok might give other useful
hints.


Regards




-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org



Enquiry

2015-04-09 Thread Naomi Obinegbo
Dear Dev, 

I am having issues with spell check on open office. It underlines all the words 
in red. I have tried all the things posted on the forum but nothing has solved 
the issue. 

Regards, 

Naomi 


Re: Enquiry

2015-04-09 Thread Alexandro Colorado
Make sure you own the right dictionary.
https://wiki.openoffice.org/wiki/Dictionaries

On Thu, Apr 9, 2015 at 10:28 AM, Naomi Obinegbo naomiobine...@yahoo.co.uk
wrote:

 Dear Dev,

 I am having issues with spell check on open office. It underlines all the
 words in red. I have tried all the things posted on the forum but nothing
 has solved the issue.

 Regards,

 Naomi




-- 
Alexandro Colorado
Apache OpenOffice Contributor
882C 4389 3C27 E8DF 41B9  5C4C 1DB7 9D1C 7F4C 2614


RE: ruby uno to control openoffice

2015-04-09 Thread Dennis E. Hamilton
I think we have a misunderstanding somehow.

I need to take some time to reflect on what you have discovered and also look 
at the codee.

I have pressure to complete some other commitments.

After April 15, I will dig deeper.

Thank you for your digging into this.  It has been instructive.

Namaste,

 - Dennis

-Original Message-
From: Brick Ma [mailto:brickman...@gmail.com] 
Sent: Wednesday, April 8, 2015 04:30
To: dev; Dennis Hamilton
Subject: Re: ruby uno to control openoffice

Hi,Dennis
I replace openoffice 3.4.1 to openoffice4.1.1.

static const ::sal_Int16 OPTIONAL = (sal_Int16)256;//still I commented line

Runo can open a writer with no error .
There are may be errors later since i commented that line .But the main
problem seems is that the openoffice version
is not right.

I want to share my pleasure with you and the community.
Thanks for all the help.

cheers

On Fri, Apr 3, 2015 at 11:26 PM, Brick Ma brickman...@gmail.com wrote:

 10 files in  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
 has #define OPTIONAL.
 I don't know how to do with these files,then i replaced all the OPTIONAL
 to XOPTIONAL.Compile is OK,but the script shows the same error .Maybe
 something else wrong?

 -Brick

 On Fri, Apr 3, 2015 at 2:52 AM, Dennis E. Hamilton 
 dennis.hamil...@acm.org wrote:

 Yes, the (#define OPTIONAL OPTIONAL) will break many things, even if it
 removes a parser error message.

 Where the error occurred the first time, there are many lines the same.
 See if you can find either declarations or #define statements for any of
 those capitalized names that do not fail.

 There may be clues there.

  - Dennis

 -Original Message-
 From: Brick Ma [mailto:brickman...@gmail.com]
 Sent: Thursday, April 2, 2015 08:47
 To: dev; Dennis Hamilton
 Subject: Re: ruby uno to control openoffice

 I wrote a line(#define OPTIONAL OPTIONAL) in PropertyAttribute.hdl.
 It seems works.

 E:\RUNO-master\include\com/sun/star/beans/PropertyAttribute.hdl(3) :
 warning C40
 05: 'OPTIONAL' : macro redefinition
 C:\Program Files (x86)\Microsoft
 SDKs\Windows\v7.0A\include\windef.h(84)  //got u
  : see previous definition of 'OPTIONAL'

 There is another error shows as follows.

 C:\OpenOffice\Basis\sdk\include\systools/win32/snprintf.h(85) : error
 C2375: 'ru
 by_snprintf' : redefinition; different linkage
 c:\ruby-2.2\include\ruby-2.2.0\ruby/ruby.h(1809) : see declaration
 of 'r
 uby_snprintf'

 Rename snprintf in snprintf.h or ruby_snprintf in ruby.h compiles.
 But when i try to open a document,error comes out.

 code:
 require 'uno'
 data = {'type' = 'socket', 'host' = 'localhost',
 'port' = 2083, 'protocol' = 'urp'}
 ctx = Uno::Connector.connect(data) //runo can connect to openoffice,if
 openoffice is not ready,runo will say no connection.
 smgr = ctx.getServiceManager
 desktop = smgr.createInstanceWithContext(
com.sun.star.frame.Desktop,ctx) //error comes
 doc = desktop.loadComponentFromURL(private:factory/swriter, _blank, 0,
 [])
 doc.getText.setString(Hello Ruby!)

 error:
 runo_exception_exception, 0
 #Uno::Com::Sun::Star::Uno::RuntimeException:
 Uno::Com::Sun::Star::Uno::RuntimeE
 xception
 t.rb:6:in `method_missing': Uno::Com::Sun::Star::Uno::RuntimeException
 (Uno::Com
 ::Sun::Star::Uno::RuntimeException)
 from t.rb:6:in `main'
 shell returned 1
 :in `method_missing': Uno::Com::Sun::Star::Uno::RuntimeException (Uno::Com
 ::Sun::Star::Uno::RuntimeException)
 from t.rb:6:in `main'
 shell returned 1

 The same error as  i met before.
 Oh,what should i do?

 -Brick


 On Thu, Apr 2, 2015 at 2:08 AM, Brick Ma brickman...@gmail.com wrote:

  Thanks for your patient and detailed reply,Dennis.
 
  You are right.OPTIONAL was replaced by preprocessor.
  cl /P yields module.i
  OPTIONAL was disappeard in module.i
  But i have not found where is #define OPTIONAL .
  I will search again tomorrow.
  -brick
 
  On Wed, Apr 1, 2015 at 10:56 AM, Dennis E. Hamilton 
  dennis.hamil...@acm.org wrote:
 
  You cannot disable the preprocessor.  That will cause *everything* to
  fail.
 
  Some place, there is a
 
  #define OPTIONAL value
 
  That you want to work.  It might be in an #include file.  Ideally, it
 is
  in the same file where it is being used, but that may be unlikely.
 
  You need to find all of the places in the code that uses that header
 and
  uses OPTIONAL and it is not in anything like #ifdef OPTIONAL but some
 usage
  where it is clear that a variable or expression form is expected in
 regular
  code.  That is likely the one place where you are seeing the failure.
 
  The clean fix is to change the name in both places.  Most programs are
  careful to do this in the first place, to avoid conflicts with other
 usage
  of a similar term.
 
  Because this is an .hdl, it may be more complicated than that.  There
 may
  also be failures elsewhere that are undetected because they do not
 cause a
  syntax error.
 
  I am not 

RE: Need help with strings

2015-04-09 Thread Dennis E. Hamilton
Hi!

You are digging into my favorite subject.

I am assuming you are talking about strings within the MathML and that it is in 
some form of XML. In that case:

If it is XML, the encoding can be specified in the ? ... ? XML prologue.  
Sniffing for this prologue will determine such things as whether UTF8 or UTF16, 
and big-endian or little-endian.  If single-byte, that will usually mean some 
kind of code page which has a subset of ASCII as a common subset of a larger 
encoding, such as Western European.  In that case, one can read the content of 
the prefix to see what it says, because it should be in a simple, pure ASCII 
form.  Even if it is a double-byte character encoding, such as Shift-JIS, the 
prologue only needs the single-byte portions that are the same as ASCII.

The default, however, depends on the MIME type of the XML file.  Text/xml and 
application/xml have different defaults.  Also, MIME types can have parameters 
that specify character sets.

The way Windows manages this also includes using a Unicode prefix on UTF8 
(big-endian, I think).  These are not uniformly used across platforms.

Internally, because ODF and AOO are Unicode based, it is necessary to translate 
all arriving text into Unicode for internal storage and use by the application. 
 To do otherwise, lies madness.  There are difficulties with this, because 
Unicode allows local specializations. This comes up in craziness around Symbol 
fonts that do not have common Unicode correspondence.  (Bullets in AOO have 
this disease.)

I have probably provided more information than you require.  I love this 
subject.  

I have not looked at your code.

 - Dennis

PS: The default representation of XML inside OOXML is UTF16 as I recall.  I 
could be mistaken.

-Original Message-
From: Regina Henschel [mailto:rb.hensc...@t-online.de] 
Sent: Wednesday, April 8, 2015 12:02
To: AOO dev
Subject: Need help with strings

Hi all,

I'm going to improve the MathML type detection. Currently there exist 
files, that can be opened or imported fine, when the type detection 
would allow it. https://bz.apache.org/ooo/show_bug.cgi?id=126230

I have attached a C++ file to show what I want to do.
The problem is, that MathML does not need to be encoded in utf-8 but can 
have any other encoding. For example MS Windows Math Input Control 
exports formulas in utf-16.

So my question is, which kind of string can I use, that is able to 
detect/use utf-16 and has the needed methods similar to C++ string 
methods find, rfind, insert, substring, clear, erase? Does AOO has such 
kind of string?

It is possible to get the encoding from the MathML file or set default 
utf-8, in case that information is needed for to instantiate a string 
object.

Kind regards
Regina





-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org



Re: Windows buildbot failures -- can you help?

2015-04-09 Thread Ariel Constenla-Haile
On Wed, Apr 08, 2015 at 04:49:36PM +0100, Gavin McDonald wrote:
  Yes, it seems that someone must open a JIRA ticket and request access to
  the buildbot.
 
 Ok so the win7 build machine is maintained by Infra; and no accounts are 
 issued. 
 
 feel free to open a BUILDS jira and I’ll take a look.
 
 https://issues.apache.org/jira/browse/BUILDS 

Thanks for the hint. Done at
https://issues.apache.org/jira/browse/BUILDS-70


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature