Kaydet (Commit) d6d1fc26 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:singlevalfields in svx(part1)

Change-Id: I9f655f0573ea301faa6cb54733832c26864eae4f
Reviewed-on: https://gerrit.libreoffice.org/26639Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 98747742
......@@ -227,9 +227,6 @@ protected:
SdrTextObj *mpNextInChain = nullptr;
SdrTextObj *mpPrevInChain = nullptr;
// indicating the for its text to be chained to another text box
bool mbToBeChained : 1;
// Fuer beschriftete Zeichenobjekte ist bTextFrame=FALSE. Der Textblock
// wird dann hoizontal und vertikal an aRect zentriert. Bei bTextFrame=
// sal_True wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen
......@@ -237,7 +234,6 @@ protected:
bool bTextFrame : 1;
bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten
bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame)
bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole)
bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame)
bool bTextSizeDirty : 1;
......@@ -254,9 +250,6 @@ protected:
// - Positions+Groesse Dialog
bool bDisableAutoWidthOnDragging : 1;
// Allow text suppression
bool mbTextHidden : 1;
// Flag for allowing text animation. Default is sal_true.
bool mbTextAnimationAllowed : 1;
......@@ -356,7 +349,6 @@ public:
bool IsFitToSize() const;
// Chaining
bool IsToBeChained() const;
SdrTextObj *GetNextLinkInChain() const;
void SetNextLinkInChain(SdrTextObj *);
SdrTextObj *GetPrevLinkInChain() const;
......
......@@ -169,16 +169,12 @@ protected:
bool mbGlueVisible2 : 1; // Also show glue points for GluePointEdit
bool mbGlueVisible3 : 1; // Also show glue points for EdgeTool
bool mbGlueVisible4 : 1; // Show glue points, if one edge is selected
bool mbRestoreColors : 1; // Pens and Brushes are reset
bool mbSomeObjChgdFlag : 1;
bool mbSwapAsynchron : 1;
bool mbPrintPreview : 1;
// These bools manage, the status that is displayed
//
// Enter/Leave group: default is true, but is set to false in
// e.g. Chart, where we'd get Ghost effects when rendering
bool mbVisualizeEnteredGroup : 1;
bool mbAnimationPause : 1;
// Flag which decides if buffered output for this view is allowed. When
......@@ -294,9 +290,6 @@ public:
// Data read access on logic HitTolerance and MinMoveTolerance
sal_uInt16 getHitTolLog() const { return mnHitTolLog; }
// Flag for group visualization
bool DoVisualizeEnteredGroup() const { return mbVisualizeEnteredGroup; }
// Using the DragState we can tell e.g. which distance was
// already dragged
const SdrDragStat& GetDragStat() const { return maDragStat; }
......
......@@ -124,7 +124,6 @@ protected:
bool bMoveOnlyDragging : 1; // only move objects while Resize/Rotate/...
bool bSlantButShear : 1; // use slant instead of shear
bool bCrookNoContortion : 1; // no contorsion while Crook
bool bHlplFixed : 1; // sal_True= fixed auxiliary lines, so it isn't movable
bool bEliminatePolyPoints : 1;
protected:
......
......@@ -282,13 +282,9 @@ class SVX_DLLPUBLIC SdrFormatter {
long nMul_;
long nDiv_;
short nKomma_;
bool bSrcFU;
bool bDstFU;
bool bDirty;
MapUnit eSrcMU;
MapUnit eDstMU;
FieldUnit eSrcFU;
FieldUnit eDstFU;
private:
SVX_DLLPRIVATE void Undirty();
SVX_DLLPRIVATE void ForceUndirty() const { if (bDirty) const_cast<SdrFormatter*>(this)->Undirty(); }
......@@ -297,13 +293,9 @@ public:
: nMul_(0)
, nDiv_(0)
, nKomma_(0)
, bSrcFU(false)
, bDstFU(false)
, bDirty(true)
, eSrcMU(eSrc)
, eDstMU(eDst)
, eSrcFU(FUNIT_NONE)
, eDstFU(FUNIT_NONE)
{
}
void TakeStr(long nVal, OUString& rStr) const;
......
......@@ -69,8 +69,6 @@ class SVX_DLLPUBLIC SdrViewIter
SdrView* mpAktView;
size_t mnListenerNum;
sal_uInt32 mnPageViewNum;
sal_uInt32 mnOutDevNum;
// bitfield
bool mbNoMasterPage : 1;
......
......@@ -32,7 +32,6 @@ namespace svx
class SVX_DLLPUBLIC ToolboxAccess
{
private:
bool m_bDocking;
OUString m_sToolboxResName;
css::uno::Reference<
css::frame::XLayoutManager > m_xLayouter;
......
......@@ -82,8 +82,6 @@ private:
TextChain *mpTextChain;
bool bCheckedFlowEvents;
bool bUnderflow;
bool bOverflow;
};
......
......@@ -63,8 +63,6 @@ protected:
// Migrate selections
Impl3DMirrorConstructOverlay* mpMirrorOverlay;
bool bDoubleSided;
void InitView();
void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
......
......@@ -31,12 +31,11 @@ namespace basegfx { class B3DRange; } // end of namespace basegfx
/*************************************************************************
|*
|* enums for projection and aspect ratio
|* enums for projection
|*
\************************************************************************/
enum ProjectionType { PR_PARALLEL, PR_PERSPECTIVE };
enum AspectMapType { AS_NO_MAPPING, AS_HOLD_SIZE, AS_HOLD_X, AS_HOLD_Y };
/*************************************************************************
......@@ -57,8 +56,6 @@ class SVX_DLLPUBLIC Viewport3D
double fVPD; // View Plane Distance
ProjectionType eProjection; // kind of the projection
AspectMapType eAspectMapping; // flag for the acclimatization of the aspect ratio
// for display on the device
Rectangle aDeviceRect; // position and size of the output area
struct
......@@ -91,8 +88,6 @@ class SVX_DLLPUBLIC Viewport3D
{ eProjection = ePrj; bTfValid = false; }
ProjectionType GetProjection() const { return eProjection; }
AspectMapType GetAspectMapping() { return eAspectMapping; }
void SetViewWindow(double fX, double fY, double fW, double fH);
void SetDeviceWindow(const Rectangle& rRect);
......
......@@ -333,8 +333,7 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera)
SetRectsDirty();
// Turn off ratio
if(aCamera.GetAspectMapping() == AS_NO_MAPPING)
GetCameraSet().SetRatio(0.0);
GetCameraSet().SetRatio(0.0);
// Set Imaging geometry
basegfx::B3DPoint aVRP(aCamera.GetViewPoint());
......
......@@ -1531,7 +1531,6 @@ void E3dView::InitView ()
nVDefaultSegments = 12;
aDefaultLightColor = RGB_Color(COL_WHITE);
aDefaultAmbientColor = RGB_Color(COL_BLACK);
bDoubleSided = false;
mpMirrorOverlay = nullptr;
}
......
......@@ -28,7 +28,6 @@ Viewport3D::Viewport3D() :
aPRP(0, 0, 2),
fVPD(-3),
eProjection(PR_PERSPECTIVE),
eAspectMapping(AS_NO_MAPPING),
aDeviceRect(Point(0,0), Size(-1,-1)),
aViewPoint (0, 0, 5000),
bTfValid(false),
......@@ -130,50 +129,7 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect)
{
long nNewW = rRect.GetWidth();
long nNewH = rRect.GetHeight();
long nOldW = aDeviceRect.GetWidth();
long nOldH = aDeviceRect.GetHeight();
switch ( eAspectMapping )
{
double fRatio, fTmp;
// Mapping, without changing the real size of the objects in the
// Device Window
case AS_HOLD_SIZE:
// When the Device is invalid (w, h = -1), adapt the View
// with AsHoldX
if ( nOldW > 0 && nOldH > 0 )
{
fRatio = (double) nNewW / nOldW;
aViewWin.X *= fRatio;
aViewWin.W *= fRatio;
fRatio = (double) nNewH / nOldH;
aViewWin.Y *= fRatio;
aViewWin.H *= fRatio;
break;
}
SAL_FALLTHROUGH;
case AS_HOLD_X:
if (nNewW == 0)
throw o3tl::divide_by_zero();
// Adapt view height to view width
fRatio = (double) nNewH / nNewW;
fTmp = aViewWin.H;
aViewWin.H = aViewWin.W * fRatio;
aViewWin.Y = aViewWin.Y * aViewWin.H / fTmp;
break;
case AS_HOLD_Y:
if (nNewH == 0)
throw o3tl::divide_by_zero();
// Adapt view width to view height
fRatio = (double) nNewW / nNewH;
fTmp = aViewWin.W;
aViewWin.W = aViewWin.H * fRatio;
aViewWin.X = aViewWin.X * aViewWin.W / fTmp;
break;
default: break;
}
fWRatio = nNewW / aViewWin.W;
fHRatio = nNewH / aViewWin.H;
......
......@@ -107,7 +107,7 @@ void ObjectContact::ProcessDisplay(DisplayInfo& /*rDisplayInfo*/)
// test if visualizing of entered groups is switched on at all
bool ObjectContact::DoVisualizeEnteredGroup() const
{
// Don not do that as default
// Do not do that as default
return false;
}
......
......@@ -348,8 +348,7 @@ namespace sdr
// test if visualizing of entered groups is switched on at all
bool ObjectContactOfPageView::DoVisualizeEnteredGroup() const
{
SdrView& rView = GetPageWindow().GetPageView().GetView();
return rView.DoVisualizeEnteredGroup();
return true;
}
// get active group's (the entered group) ViewContact
......
......@@ -517,7 +517,6 @@ namespace drawinglayer
const SdrTextObj& rTextObj = rText.GetObject();
// Save chaining attributes
bool bToBeChained = rTextObj.IsToBeChained();
bool bChainable = rTextObj.IsChainable();
......@@ -580,7 +579,7 @@ namespace drawinglayer
bInEditMode,
static_cast<const SdrTextFixedCellHeightItem&>(rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(),
bWrongSpell,
bToBeChained,
false/*bToBeChained*/,
bChainable);
}
......
......@@ -91,18 +91,13 @@ SdrTextObj::SdrTextObj()
bTextFrame=false;
bPortionInfoChecked=false;
bNoShear=false;
bNoRotate=false;
bNoMirror=false;
bDisableAutoWidthOnDragging=false;
mbInEditMode = false;
mbTextHidden = false;
mbTextAnimationAllowed = true;
maTextEditOffset = Point(0, 0);
// chaining
mbToBeChained = false;
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
mbInDownScale = false;
......@@ -119,20 +114,15 @@ SdrTextObj::SdrTextObj(const Rectangle& rNewRect)
bTextFrame=false;
bPortionInfoChecked=false;
bNoShear=false;
bNoRotate=false;
bNoMirror=false;
bDisableAutoWidthOnDragging=false;
ImpJustifyRect(maRect);
mbInEditMode = false;
mbTextHidden = false;
mbTextAnimationAllowed = true;
mbInDownScale = false;
maTextEditOffset = Point(0, 0);
// chaining
mbToBeChained = false;
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
}
......@@ -147,19 +137,14 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind)
bTextFrame=true;
bPortionInfoChecked=false;
bNoShear=true;
bNoRotate=false;
bNoMirror=true;
bDisableAutoWidthOnDragging=false;
mbInEditMode = false;
mbTextHidden = false;
mbTextAnimationAllowed = true;
mbInDownScale = false;
maTextEditOffset = Point(0, 0);
// chaining
mbToBeChained = false;
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
}
......@@ -175,16 +160,11 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect)
bTextFrame=true;
bPortionInfoChecked=false;
bNoShear=true;
bNoRotate=false;
bNoMirror=true;
bDisableAutoWidthOnDragging=false;
ImpJustifyRect(maRect);
// chaining
mbToBeChained = false;
mbInEditMode = false;
mbTextHidden = false;
mbTextAnimationAllowed = true;
mbInDownScale = false;
maTextEditOffset = Point(0, 0);
......@@ -1103,7 +1083,6 @@ SdrTextObj& SdrTextObj::operator=(const SdrTextObj& rObj)
// Not all of the necessary parameters were copied yet.
bNoShear = rObj.bNoShear;
bNoRotate = rObj.bNoRotate;
bNoMirror = rObj.bNoMirror;
bDisableAutoWidthOnDragging = rObj.bDisableAutoWidthOnDragging;
......@@ -1528,12 +1507,6 @@ void SdrTextObj::ForceOutlinerParaObject()
}
}
// chaining
bool SdrTextObj::IsToBeChained() const
{
return mbToBeChained;
}
TextChain *SdrTextObj::GetTextChain() const
{
//if (!IsChainable())
......
......@@ -824,10 +824,7 @@ bool SdrPageView::EnterGroup(SdrObject* pObj)
GetView().AdjustMarkHdl();
// invalidate only when view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
{
InvalidateAllWin();
}
InvalidateAllWin();
if (bGlueInvalidate)
{
......@@ -870,8 +867,7 @@ void SdrPageView::LeaveOneGroup()
GetView().AdjustMarkHdl();
// invalidate only if view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
InvalidateAllWin();
InvalidateAllWin();
if(bGlueInvalidate)
GetView().GlueInvalidate();
......@@ -908,8 +904,7 @@ void SdrPageView::LeaveAllGroup()
GetView().AdjustMarkHdl();
// invalidate only when view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
InvalidateAllWin();
InvalidateAllWin();
if(bGlueInvalidate)
GetView().GlueInvalidate();
......
......@@ -175,7 +175,6 @@ void SdrPaintView::ImpClearVars()
mnMinMovLog=0;
mpActualOutDev=nullptr;
mpDragWin=nullptr;
mbRestoreColors=true;
mpDefaultStyleSheet=nullptr;
mbSomeObjChgdFlag=false;
mnGraphicManagerDrawMode = GraphicManagerDrawFlags::STANDARD;
......@@ -207,9 +206,6 @@ SdrPaintView::SdrPaintView(SdrModel* pModel, OutputDevice* pOut)
AddWindowToPaintView(pOut, nullptr);
}
// flag to visualize groups
mbVisualizeEnteredGroup = true;
maColorConfig.AddListener(this);
onChangeColorConfig();
}
......
......@@ -196,7 +196,6 @@ SdrSnapView::SdrSnapView(SdrModel* pModel1, OutputDevice* pOut)
, bMoveOnlyDragging(false)
, bSlantButShear(false)
, bCrookNoContortion(false)
, bHlplFixed(false)
, bEliminatePolyPoints(false)
{
}
......@@ -518,25 +517,22 @@ bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV)
{
bool bRet(false);
if(!bHlplFixed)
{
BrkAction();
BrkAction();
if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
{
const SdrHelpLineList& rHelpLines = pPV->GetHelpLines();
const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
Point aHelpLinePos = rHelpLine.GetPos();
basegfx::B2DPoint aStartPos(aHelpLinePos.X(), aHelpLinePos.Y());
if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
{
const SdrHelpLineList& rHelpLines = pPV->GetHelpLines();
const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
Point aHelpLinePos = rHelpLine.GetPos();
basegfx::B2DPoint aStartPos(aHelpLinePos.X(), aHelpLinePos.Y());
DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, pPV, nHelpLineNum, rHelpLine.GetKind());
DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, pPV, nHelpLineNum, rHelpLine.GetKind());
maDragStat.Reset(GetSnapPos(aHelpLinePos, pPV));
maDragStat.SetMinMove(ImpGetMinMovLogic(-3, nullptr));
maDragStat.Reset(GetSnapPos(aHelpLinePos, pPV));
maDragStat.SetMinMove(ImpGetMinMovLogic(-3, nullptr));
bRet = true;
}
bRet = true;
}
return bRet;
......
......@@ -690,41 +690,6 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool&
rbInch=bInch;
}
void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch)
{
rnMul=1; rnDiv=1;
short nKomma=0;
bool bMetr = false, bInch = false;
switch (eFU) {
case FUNIT_NONE : break;
// metrically
case FUNIT_100TH_MM : bMetr = true; nKomma=5; break;
case FUNIT_MM : bMetr = true; nKomma=3; break;
case FUNIT_CM : bMetr = true; nKomma=2; break;
case FUNIT_M : bMetr = true; nKomma=0; break;
case FUNIT_KM : bMetr = true; nKomma=-3; break;
// Inch
case FUNIT_TWIP : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
case FUNIT_POINT : bInch = true; rnDiv=72; break; // 1Pt = 1/72"
case FUNIT_PICA : bInch = true; rnDiv=6; break; // 1Pica = 1/6" ?
case FUNIT_INCH : bInch = true; break; // 1" = 1"
case FUNIT_FOOT : bInch = true; rnMul=12; break; // 1Ft = 12"
case FUNIT_MILE : bInch = true; rnMul=6336; nKomma=-1; break; // 1mile = 63360"
// others
case FUNIT_CUSTOM : break;
case FUNIT_PERCENT : nKomma=2; break;
// TODO: Add code to handle the following (added to remove warning)
case FUNIT_CHAR : break;
case FUNIT_LINE : break;
case FUNIT_PIXEL : break;
case FUNIT_DEGREE : break;
case FUNIT_SECOND : break;
case FUNIT_MILLISECOND : break;
} // switch
rnKomma=nKomma;
rbMetr=bMetr;
rbInch=bInch;
}
void SdrFormatter::Undirty()
{
......@@ -732,16 +697,8 @@ void SdrFormatter::Undirty()
long nMul1,nDiv1,nMul2,nDiv2;
short nKomma1,nKomma2;
// first: normalize to m or in
if (!bSrcFU) {
GetMeterOrInch(eSrcMU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch);
} else {
GetMeterOrInch(eSrcFU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch);
}
if (!bDstFU) {
GetMeterOrInch(eDstMU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch);
} else {
GetMeterOrInch(eDstFU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch);
}
GetMeterOrInch(eSrcMU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch);
GetMeterOrInch(eDstMU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch);
nMul1*=nDiv2;
nDiv1*=nMul2;
nKomma1=nKomma1-nKomma2;
......
......@@ -31,8 +31,6 @@
void SdrViewIter::ImpInitVars()
{
mnListenerNum = 0L;
mnPageViewNum = 0L;
mnOutDevNum = 0L;
mpAktView = nullptr;
}
......
......@@ -32,7 +32,6 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
mpTextChain = mpTargetLink->GetTextChain();
mpNextLink = mpTargetLink->GetNextLinkInChain();
bCheckedFlowEvents = false;
bUnderflow = bOverflow = false;
......
......@@ -1706,7 +1706,6 @@ SdrTableObj& SdrTableObj::operator=(const SdrTableObj& rObj)
aTextSize = rObj.aTextSize;
bTextSizeDirty = rObj.bTextSizeDirty;
bNoShear = rObj.bNoShear;
bNoRotate = rObj.bNoRotate;
bNoMirror = rObj.bNoMirror;
bDisableAutoWidthOnDragging = rObj.bDisableAutoWidthOnDragging;
......
......@@ -35,10 +35,7 @@ namespace svx
#define PROPNAME_LAYOUTMANAGER "LayoutManager"
ToolboxAccess::ToolboxAccess( const ::rtl::OUString& rToolboxName ) :
m_bDocking ( false ),
m_sToolboxResName ( TOOLBAR_RESNAME )
{
m_sToolboxResName += rToolboxName;
......@@ -77,11 +74,6 @@ namespace svx
{
xManager->createElement( m_sToolboxResName );
xManager->showElement( m_sToolboxResName );
css::awt::Point aPos;
if ( m_bDocking )
xManager->dockWindow( m_sToolboxResName,
css::ui::DockingArea_DOCKINGAREA_BOTTOM, aPos );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment