Re: Investigation into bug 35862 - allow increase/decrease font for text selection with multiple font sizes

2012-03-27 Thread Ahmed
Logic in this line is executed when selecting text in different sizes in
writer, and it disables buttons.
 if( !aSetItem.GetItemOfScript( rSh.GetScriptType() )) 
rSet.DisableItem( nSlot ); 

I tried to comment the line and test without it to see if it works - now
buttons are visible but increasing or decreasing fonts in different sizes
are still  not working! 

I think that case FN_GROW_FONT_SIZE and case FN_SHRINK_FONT_SIZE in method 
void SwTextShell::ExecCharAttrArgs(SfxRequest rReq) are responsible for
actual increase and decrease
and the problem may be here.


--
View this message in context: 
http://nabble.documentfoundation.org/Investigation-into-bug-35862-allow-increase-decrease-font-for-text-selection-with-multiple-font-sizes-tp3855568p3860755.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Investigation into bug 35862 - allow increase/decrease font for text selection with multiple font sizes

2012-03-26 Thread Michael Meeks
Hi Jordan,

On Sat, 2012-03-24 at 14:06 -0700, Jordan Chin wrote:
 I began investigating this bug: 
 https://bugs.freedesktop.org/show_bug.cgi?id=35862

Lovely ! :-)

 The bug is that the Increase Font/Decrease Font button should be 
 useable when one selects text of multiple sizes in Writer.

Right, that'd be really useful.

 I tried to find where the button was being used and found that the 
 button for, for example, increasing the font size has an ID referenced
 as FN_GROW_FONT_SIZE. I put print statements for any references I found
 and was able to find the code that is executed when the button is clicked

Great detective work so far :-)

 but I don't know what code activates/deactivates the actual 
 buttons. I suspect that since this functionality is available in Impress
 but not Writer (which is what the bug is about), there could be some clue
 if we consider where the code between Writer/Impress differs.

Good thought.

 Currently I suspect the file svx/sdi/svx.sdi might have information, in 
 the definition of

So here is the sdi for this method:

sw/sdi/_textsh.sdi:FN_GROW_FONT_SIZE // status(final|play)
sw/sdi/_textsh.sdi-[
sw/sdi/_textsh.sdi-ExecMethod = ExecCharAttrArgs ;
sw/sdi/_textsh.sdi-StateMethod = GetAttrState ;
sw/sdi/_textsh.sdi-
DisableFlags=SW_DISABLE_ON_PROTECTED_CURSOR;
sw/sdi/_textsh.sdi-]

The 'StateMethod' is used to determine whether the button should be
enabled or disabled.

 As I am new to LibreOffice, I'm wondering if anyone has any ideas where 
 I can look next?

So - poking at that 'GetAttrState' method we see:

sw/source/ui/shells/txtattr.cxx (SwTextShell::GetAttrState)
...
case FN_GROW_FONT_SIZE:
case FN_SHRINK_FONT_SIZE:
{
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONTHEIGHT,
*rSet.GetPool() );
aSetItem.GetItemSet().Put( aCoreSet, sal_False );
if( !aSetItem.GetItemOfScript( rSh.GetScriptType() ))
rSet.DisableItem( nSlot );
nSlot = 0;
}
break;

And - I suspect - that this rSet.DisableItem is what you're wanting to
avoid :-)

Though - of course, I may be wildly wrong, I often am.

Thanks for working on this, looking forward to seeing it in action.

Having said that; I guess having the ability to do some nice font size
increase across a set of selected styles would be cool too ;-)

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


Investigation into bug 35862 - allow increase/decrease font for text selection with multiple font sizes

2012-03-25 Thread Jordan Chin

Hi devs,

I began investigating this bug: 
https://bugs.freedesktop.org/show_bug.cgi?id=35862


The bug is that the Increase Font/Decrease Font button should be 
useable when one

selects text of multiple sizes in Writer.

I tried to find where the button was being used and found that the 
button for, for example,
increasing the font size has an ID referenced as FN_GROW_FONT_SIZE. I 
put print statements
for any references I found and was able to find the code that is 
executed when the button
is clicked, but I don't know what code activates/deactivates the actual 
buttons. I suspect
that since this functionality is available in Impress but not Writer 
(which is what the bug
is about), there could be some clue if we consider where the code 
between Writer/Impress differs.


Currently I suspect the file svx/sdi/svx.sdi might have information, in 
the definition of


SfxVoidItem Grow SID_GROW_FONT_SIZE

but I don't know how this hooks in with the application.

As I am new to LibreOffice, I'm wondering if anyone has any ideas where 
I can look next?


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