mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fixed getMaxWidth() in insetminipage if the width is a percentage and fixed
insetButtonRelease in insettabular. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3319 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dde058d322
commit
dca91cf463
@ -1,5 +1,11 @@
|
||||
2002-01-08 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* insettabular.C (insetButtonRelease): now this should work too
|
||||
correctly.
|
||||
|
||||
* insetminipage.C (getMaxWidth): fixed for minipage inside insets and
|
||||
if the width is a percentage.
|
||||
|
||||
* inset.h: added isChar() function and implemented this for
|
||||
insetspecialchar insetquotes and insetlatexaccent.
|
||||
added forceDefaultParagraphs() and implemented it for insettabular.
|
||||
|
@ -327,13 +327,29 @@ bool InsetMinipage::showInsetDialog(BufferView * bv) const
|
||||
int InsetMinipage::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
|
||||
const
|
||||
{
|
||||
if (owner() &&
|
||||
(static_cast<UpdatableInset*>(owner())->getMaxWidth(bv, inset) < 0))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (!width_.empty()) {
|
||||
int ww1 = VSpace(width_).inPixels(bv);
|
||||
int ww2 = InsetCollapsable::getMaxWidth(bv, inset);
|
||||
if (ww2 > 0 && ww2 < ww1) {
|
||||
return ww2;
|
||||
LyXLength len(width_);
|
||||
switch(len.unit()) {
|
||||
case LyXLength::PW: // Always % of workarea
|
||||
case LyXLength::PE:
|
||||
case LyXLength::PP:
|
||||
case LyXLength::PL:
|
||||
return (InsetCollapsable::getMaxWidth(bv, inset) * (int)len.value()) / 100;
|
||||
default:
|
||||
{
|
||||
int ww1 = VSpace(width_).inPixels(bv);
|
||||
int ww2 = InsetCollapsable::getMaxWidth(bv, inset);
|
||||
if (ww2 > 0 && ww2 < ww1) {
|
||||
return ww2;
|
||||
}
|
||||
return ww1;
|
||||
}
|
||||
}
|
||||
return ww1;
|
||||
}
|
||||
// this should not happen!
|
||||
return InsetCollapsable::getMaxWidth(bv, inset);
|
||||
|
@ -796,7 +796,8 @@ bool InsetTabular::insetButtonRelease(BufferView * bv,
|
||||
{
|
||||
bool ret = false;
|
||||
if (the_locking_inset)
|
||||
ret = the_locking_inset->insetButtonRelease(bv, x, y, button);
|
||||
ret = the_locking_inset->insetButtonRelease(bv, x - inset_x,
|
||||
y - inset_y, button);
|
||||
if (button == 3 && !ret) {
|
||||
bv->owner()->getDialogs()->showTabular(this);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user