Re: Calc / Kerning

2012-11-21 Thread Bernhard Schiffner
   Cool :-) so one area we're trying to get people to help-out with before
 the feature-freeze for 4.0 (which is now under 2 weeks away) is:
 
   https://wiki.documentfoundation.org/Development/WidgetLayout

Read it now (11-21-12). I like this type of work.
But not for 4.0 (I must become common with the tools first.)

   Converting old  ugly dialogs to the new .ui format - there are plenty
 of older dialogs in calc (and elsewhere) that need that attention, any
 chance of having a poke at some of them ?

(Do some make a difference here?)
As example:
cat sc/source/ui/src/popup.src
IIUC this file needs a couple of *.ui to be built based on it.
Double check with cui/ ... first, check for dead entries, add usefull comments: 
it will take some time (for me).

 It seems the re-work of the
 calc / string handling core is rather an advanced post 4.0 feature :-)

Seems so.
 
   All the best,
 
   Michael.

Bernhard

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-21 Thread Bernhard Schiffner
Am Montag, 19. November 2012, 09:43:48 schrieb Kohei Yoshida:

 4.) What's about something like =cell(resulting_string, A1)  be it API or
 internal?

 Sorry, you lost me here. What exactly do you want this function to do?

Preparing (or doing) a type cast to the rtf formatable cell format.

 Kohei

Thanks!

Bernhard




___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-19 Thread Kohei Yoshida
On Fri, Nov 16, 2012 at 3:48 PM, Bernhard Schiffner 
bernhard.schiff...@gmx.net wrote:


 Questions:
 1.) Is it possible to text-edit a text cell directly entering something
 like
 {\b Bold}?


Nope.


 2.) Copy and paste from other rtf sources?


Yes.

3.) Is there a way to do so by (external) software?


The answer would depend on what exactly you mean by to do so here.  But
in general if you can count the extension mechanism as external software,
then it should be possible.


 4.) What's about something like =cell(resulting_string, A1)  be it API or
 internal?


Sorry, you lost me here. What exactly do you want this function to do?

Kohei
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-19 Thread Michael Meeks

On Fri, 2012-11-16 at 20:18 +0100, Bernhard Schiffner wrote:
  Bernhard - anything else you're interested in hacking on that might be
  easier ? :-)
   
 For sure! :-)

Cool :-) so one area we're trying to get people to help-out with before
the feature-freeze for 4.0 (which is now under 2 weeks away) is:

https://wiki.documentfoundation.org/Development/WidgetLayout

Converting old  ugly dialogs to the new .ui format - there are plenty
of older dialogs in calc (and elsewhere) that need that attention, any
chance of having a poke at some of them ? It seems the re-work of the
calc / string handling core is rather an advanced post 4.0 feature :-)

All the best,

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-16 Thread Kohei Yoshida

On 11/15/2012 04:09 PM, Bernhard Schiffner wrote:

Hi,

(this is my first commit here so please be patient ...)

I'am missing the kerning feature for cells showing the result of a formula.


So, there is a technical reason why achieving that for formula result is 
very difficult, I'm afraid.


Calc has two types of texts: 1) simple text, and 2) rich text.  A simple 
non-formula cell can do either text, but a formula cell currently can 
only do simple text.  When you type e.g. AV into a cell, that is simple 
text at the time the text is entered.  As soon as you apply kerning, 
though, it becomes rich text.  When you reference that in another cell 
via formula cell, that formula cell only extract that text as a simple 
text, thereby losing the kerning property.


This is due to the same reason why referencing in a formula cell a text 
that consists of part bold, part non-bold, part italic, part non-italic 
etc. becomes simple text without any format runs.


Of course, it is *possible* to support rich text properties in text 
that's a formula result, but that would require intimate knowledge of 
the inner working of Calc's cell text handling, and would probably 
requires a lot of code changes.


Best,

Kohei
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-16 Thread Michael Meeks

On Fri, 2012-11-16 at 11:06 -0500, Kohei Yoshida wrote:
 On 11/15/2012 04:09 PM, Bernhard Schiffner wrote:
  (this is my first commit here so please be patient ...)

Drat - it's not as easy as I had thought; which is a shame.

  I'am missing the kerning feature for cells showing the result of a formula.

Right.

 So, there is a technical reason why achieving that for formula result is 
 very difficult, I'm afraid.

I guess part of the problem is the difference between ScStringCell and
ScEditCell - but also the string types that we hand around inside the
formula engine all being String or at best rtl::OUString which has no
formatting. I imagine an EditTextObject is an extremely heavy-weight
replacement too ;-)

 Of course, it is *possible* to support rich text properties in text 
 that's a formula result, but that would require intimate knowledge of 
 the inner working of Calc's cell text handling, and would probably 
 requires a lot of code changes.

I played with the competition quickly; it seems they don't do this
either right ?

Bernhard - anything else you're interested in hacking on that might be
easier ? :-)

ATB,

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-16 Thread Bernhard Schiffner
Am Freitag, 16. November 2012, 18:17:09 schrieb Michael Meeks:
 On Fri, 2012-11-16 at 11:06 -0500, Kohei Yoshida wrote:
  On 11/15/2012 04:09 PM, Bernhard Schiffner wrote:
   (this is my first commit here so please be patient ...)
 
   Drat - it's not as easy as I had thought; which is a shame.
 
   I'am missing the kerning feature for cells showing the result of a
   formula.
 
   Right.
 
  So, there is a technical reason why achieving that for formula result is
  very difficult, I'm afraid.
 
   I guess part of the problem is the difference between ScStringCell and
 ScEditCell - but also the string types that we hand around inside the
 formula engine all being String or at best rtl::OUString which has no
 formatting. I imagine an EditTextObject is an extremely heavy-weight
 replacement too ;-)
 
  Of course, it is *possible* to support rich text properties in text
  that's a formula result, but that would require intimate knowledge of
  the inner working of Calc's cell text handling, and would probably
  requires a lot of code changes.
 
   I played with the competition quickly; it seems they don't do this
 either right ?
Let's do it better.
(See below.)
 
   Bernhard - anything else you're interested in hacking on that might be
 easier ? :-)
  
For sure! :-)

(My question raised from inserting spreadsheets into lowriter documents where 
the insertions were visible at the first glance, because of the use of advanced 
formating.)

But understanding the problem as Kohei explained it I don't want to give up 
the idea itself.

What about this:
While it seems very bloated to  carry all rich text formating _inside_ 
formula cells, it might be possible to create an overlay using advanced 
formating _outside_.
Think of this as having a separate spreadsheet (linked 1:1 to the generating 
spreadsheet) with the only property to add formating to the pointed results.
(Export as text - reformat)

Do you see a chance to solve the problem this way?
 
   ATB,
 
   Michael.

Thank you for all advice!


Bernhard

(Thinking a second time about the said, I start to like the idea of a special 
sheet type dedicated to layout problems.)
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-16 Thread Kohei Yoshida

On 11/16/2012 02:18 PM, Bernhard Schiffner wrote:


What about this:
While it seems very bloated to  carry all rich text formating _inside_
formula cells, it might be possible to create an overlay using advanced
formating _outside_.
Think of this as having a separate spreadsheet (linked 1:1 to the generating
spreadsheet) with the only property to add formating to the pointed results.
(Export as text - reformat)

Do you see a chance to solve the problem this way?


Sure.  But this would require a re-design of a non-trivial part of the 
Calc core.  Basically we would have to remove use of EditEngine and its 
friend and re-implement Calc's own rich-text handling framework.


The question is, is this all worth the benefit?  I personally think it's 
too risky just for a marginal gain, and goes back to what I'd said earlier:


 Of course, it is *possible* to support rich text properties in text
 that's a formula result, but that would require intimate knowledge of
 the inner working of Calc's cell text handling, and would probably
 requires a lot of code changes.

It all comes down to risk/effort vs benefit.

Kohei

--
Kohei Yoshida, LibreOffice hacker, Calc
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc / Kerning

2012-11-16 Thread Bernhard Schiffner
Am Freitag, 16. November 2012, 14:25:46 schrieben Sie:
 On 11/16/2012 02:18 PM, Bernhard Schiffner wrote:
  What about this:
  While it seems very bloated to  carry all rich text formating _inside_
  formula cells, it might be possible to create an overlay using advanced
  formating _outside_.
  Think of this as having a separate spreadsheet (linked 1:1 to the
  generating spreadsheet) with the only property to add formating to the
  pointed results. (Export as text - reformat)
  
  Do you see a chance to solve the problem this way?
 
 Sure.  But this would require a re-design of a non-trivial part of the
 Calc core.  Basically we would have to remove use of EditEngine and its
 friend and re-implement Calc's own rich-text handling framework.
That's not worth it.

State of the onion (IIUC):
-  If you input a string into a cell you can apply rich text format by graphic 
means.
- Most of the times (=function is parsed, ...) this rich text is 
automatically transformed into an other, internal format more suited for 
spreadsheet needs. 
- This conversation is triggered too if you do format-cell.
- After this transformation is done there is no easy way back to RTF.

Questions:
1.) Is it possible to text-edit a text cell directly entering something like 
{\b Bold}?
2.) Copy and paste from other rtf sources?
3.) Is there a way to do so by (external) software?
4.) What's about something like =cell(resulting_string, A1)  be it API or 
internal?

Thanks for the quick response and your patience!


Bernhard
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Calc / Kerning

2012-11-15 Thread Bernhard Schiffner
Hi,

(this is my first commit here so please be patient ...)

I'am missing the kerning feature for cells showing the result of a formula. 
The attached git diff gives an idea about what I want.

It compiles for me, shows the tab Font Position at the right place but does 
not do the kerning.
Any idea how to proceeed?

BTW 1)
The kerning feature (Font Position) is available for pure text in a cell via 
clicking input line, format-charakter-font position as you can see in
libreoffice/core/sc/source/ui/src/textdlgs.src
libreoffice/core/cui/source/tabpages/chardlg.cxx (line 2978)

BTW 2)
Applying fromat-cell for a text cell resets kerning which was selected before 
by format-character.
This can be considered as a bug, solved by implementing this idea here.

BTW 3)
libreoffice/core/cui/source/dialogs/sdrcelldlg.cxx
does have a very similar dialog. Is there some overlap?

TIA!

Bernhard


diff --git a/sc/source/ui/attrdlg/attrdlg.cxx 
b/sc/source/ui/attrdlg/attrdlg.cxx
index 2e22761..87e95be 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -68,6 +68,8 @@ ScAttrDlg::ScAttrDlg( SfxViewFrame* pFrameP,
 AddTabPage( TP_FONT, pFact-GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME 
), 0 );
 OSL_ENSURE(pFact-GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 
GetTabPageCreatorFunc fail!);
 AddTabPage( TP_FONTEFF, pFact-GetTabPageCreatorFunc( 
RID_SVXPAGE_CHAR_EFFECTS ), 0 );
+OSL_ENSURE(pFact-GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 
GetTabPageCreatorFunc fail!);
+AddTabPage( TP_FONTPOS, pFact-GetTabPageCreatorFunc( 
RID_SVXPAGE_CHAR_POSITION ), 0 );
 OSL_ENSURE(pFact-GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 
GetTabPageCreatorFunc fail!);
 AddTabPage( TP_ALIGNMENT, pFact-GetTabPageCreatorFunc( 
RID_SVXPAGE_ALIGNMENT ),0 );
 
diff --git a/sc/source/ui/inc/attrdlg.hrc b/sc/source/ui/inc/attrdlg.hrc
index 4c36756..7dd5273 100644
--- a/sc/source/ui/inc/attrdlg.hrc
+++ b/sc/source/ui/inc/attrdlg.hrc
@@ -26,6 +26,7 @@
 #define TP_PROTECTION   6
 #define TP_FONTEFF  7
 #define TP_ASIAN8
+#define TP_FONTPOS  9
 
 //
 // Protected cell TabPage:
diff --git a/sc/source/ui/src/attrdlg.src b/sc/source/ui/src/attrdlg.src
index a96bad9..da87300 100644
--- a/sc/source/ui/src/attrdlg.src
+++ b/sc/source/ui/src/attrdlg.src
@@ -65,6 +65,12 @@ TabDialog RID_SCDLG_ATTR
 };
 PageItem
 {
+Identifier = TP_FONTPOS ;
+PageResID = 264 ;
+Text [ en-US ] = Font Position;
+};
+PageItem
+{
 Identifier = TP_ALIGNMENT ;
 PageResID = 258 ;
 Text [ en-US ] = Alignment ;

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice