Need help with strings

2015-04-08 Thread Regina Henschel

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



// detect MathML
#include 
#include 

int main ()
{
// to be used in starmath/source/smdetect.cxx
// dummy sFragment with minimal MathML; will be variable 'aBuffer' later on
  const std::string sFragment("http://www.w3.org/1998/Math/MathML\x0022 >");
  std::cout << "012345678901234567890123456789012345678901234567890123456789" 
<< "\n";
  std::cout << sFragment.c_str() << "\n";

// does it have a MathML namespace attribute? First look for URL.  
  std::size_t posURL = sFragment.find("http://www.w3.org/1998/Math/MathML";);
  if (posURL != std::string::npos)
  {
// URL needs to be a attribute value, look for "="
std::size_t posEQ = sFragment.rfind("=",posURL);
if (posEQ != std::string::npos)
{
// attribute needs to be 'xmlns'
   std::size_t posXMLNS = sFragment.rfind("xmlns",posEQ);
   if (posXMLNS != std::string::npos)
   {
// look whether a prefix to 'math' is specified
  std::string sPrefix = sFragment.substr( posXMLNS+5 , 
posEQ-(posXMLNS+5) );
  if (sPrefix.length() > 0)
  {
 // remove any whitespace
 const std::string sWhitespace="\x0020\x0009\x000A\x000D";
 for (unsigned i=0; i< sPrefix.length(); ++i)
 {
if ( sWhitespace.find(sPrefix.at(i)) != std::string::npos )
{
   sPrefix.erase(i,1);   
}
 }
 // trim
 if ( sPrefix.length() > 0 && sPrefix.find(":") == 0)
 {
sPrefix.erase(0,1);
 }
 else
 {
// don't know what SAX parser does on not well-formed XML
// for now simple ignore the trash
sPrefix.clear(); 
 }
  }
  // In last step look for 0 )
  {
sMath.insert(1,":");
sMath.insert(1,sPrefix);
  }
  std::size_t posMATH = sFragment.rfind(sMath, posXMLNS);
  if (posMATH != std::string::npos)
  {
  std::cout << "MathML file" << "\n";
  }
  else
  {
  std::cout << "Not a MathML" << "\n";
  }
  
   }   

}
  }
  return 0;
}
-
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-08 Thread Gavin McDonald

> On 8 Apr 2015, at 2:15 pm, Ariel Constenla-Haile  wrote:
> 
> On Sat, Mar 28, 2015 at 09:12:15AM -0700, Kay Schenk wrote:
>> I saw these errors but since I am not on Windows, I didn't know how to
>> interpret them. Are you saying that AOO will not compile with this
>> version of MSPDBBD.DLL or, is something now wrong with this DLL?
>> 
>> In any case, I do not have root level access to the win7 buildbot. So,
>> either someone that does can check this out, or, request this type of
>> access from infra.
> 
> 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 
 

Gav…

> 
> 
> Regards
> -- 
> Ariel Constenla-Haile
> La Plata, Argentina



Re: [Issue 54923] No obvious way to quickly increase/decrease font-size from the keyboard

2015-04-08 Thread Ariel Constenla-Haile
On Tue, Apr 07, 2015 at 08:46:10AM -0400, Patrick Lynn wrote:
> --- oldAccelerators.xcu   2015-03-31 11:23:58.838929202 -0400
> +++ Accelerators.xcu  2015-04-06 17:53:01.142849021 -0400
> @@ -4480,6 +4480,11 @@
>.uno:RepeatSearch
>   
>  
> +
> + I10N 
> SHORTCUTS - NO TRANSLATE
> +  .uno:Shrink
> + 
> +
>  
>   I10N 
> SHORTCUTS - NO TRANSLATE
>.uno:RepeatSearch
> @@ -4566,6 +4571,11 @@
>.uno:WordLeftSel
>   
>  
> +
> + I10N 
> SHORTCUTS - NO TRANSLATE
> +  .uno:Shrink
> + 
> +
>  
>   I10N 
> SHORTCUTS - NO TRANSLATE
>.uno:LeftPara

a) You are using the same command, .uno:Shrink. You should use two
different commands, ".uno:Shrink" and ".uno:Grow"

b) and these commands should be bound to different key strokes. In my
keyboard layout both GREATER_SHIFT_MOD1 and LESS_SHIFT_MOD1 are the
same, see Regina's answer.

In my keyboard, < is next to SHIFT, and > is on the same key as < but
has to be accessed with SHIFT. That's why in the demo extension I used
LESS_MOD1 and GREATER_SHIFT_MOD1.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature


Re: Windows buildbot failures -- can you help?

2015-04-08 Thread Ariel Constenla-Haile
On Sat, Mar 28, 2015 at 09:12:15AM -0700, Kay Schenk wrote:
> I saw these errors but since I am not on Windows, I didn't know how to
> interpret them. Are you saying that AOO will not compile with this
> version of MSPDBBD.DLL or, is something now wrong with this DLL?
> 
> In any case, I do not have root level access to the win7 buildbot. So,
> either someone that does can check this out, or, request this type of
> access from infra.

Yes, it seems that someone must open a JIRA ticket and request access to
the buildbot.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature


Re: ruby uno to control openoffice

2015-04-08 Thread Brick Ma
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  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::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 `'
>> shell returned 1
>> :in `method_missing': Uno::Com::Sun::Star::Uno::RuntimeException (Uno::Com
>> ::Sun::Star::Uno::RuntimeException)
>> from t.rb:6:in `'
>> 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  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 
>> >>
>> >> 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 where I can look right now.  Nose around.  There should be
>> some
>> >> related definitions in the same part of the source tree.
>> >>
>> >>  - Dennis
>> >>
>> >> -Original Message-
>> >> From: Brick Ma [mailto:brickman...@gmail.com]
>> >> Sent: Monday, March 30,

Repositioning automatically sized Frames - Floating issue

2015-04-08 Thread Denis Simonet
Dear devs,

since October 2013 there is a confirmed bug report concerning frames
with autoresized heights [1].

There has been no activity from your side since November 2013, so we are
wondering what you need so you can proceed. As mentioned in the ticket,
the bug has been fixed in Libreoffice but we could not find any commit
which directly addresses this issue. There also is a partial fix
attached to the ticket which might help solving the problem.

We are looking forward to your suggestions and/or instructions.

Best regards,
Denis

[1] https://bz.apache.org/ooo/show_bug.cgi?id=123479

-- 
Adfinis SyGroup AG
Denis Simonet, Software Engineer

Keltenstrasse 98 | CH-3018 Bern
Tel. +41 31 550 31 11 | Direkt +41 31 550 31 16



signature.asc
Description: OpenPGP digital signature


Re: [CWiki] Account Whitelisting

2015-04-08 Thread Gavin McDonald
Hi Tim,

> On 8 Apr 2015, at 2:44 am, Timothy Monk  wrote:
> 
> Username:  timmonk
> 
> Real name: Timothy Monk
> 

There doesn’t seem to be a CWIKI username matching that id.

Can you check your Confluence id - if not exist please create one first.

Thanks!

Gav…


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