editeng/source/editeng/editstt2.hxx |    3 ---
 editeng/source/editeng/impedit.hxx  |    2 --
 editeng/source/editeng/impedit2.cxx |    3 +--
 editeng/source/editeng/impedit3.cxx |   35 -----------------------------------
 include/editeng/editstat.hxx        |    9 ++++-----
 sc/source/core/data/column2.cxx     |   20 --------------------
 sc/source/ui/app/inputhdl.cxx       |   15 ---------------
 sc/source/ui/view/output2.cxx       |    2 --
 8 files changed, 5 insertions(+), 84 deletions(-)

New commits:
commit b60048cbd7ac033294155f23d27bd446124b64fd
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Feb 28 10:03:59 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Feb 28 12:46:47 2024 +0100

    drop EEControlBits::FORMAT100
    
    FORMAT100 is only used by calc (since #i51508#) and looks to me as a
    workaround for the same fundamental issue addressed by contemporary
    resolution independent text layout and rendering.
    
    Change-Id: Ifd0a0adaff717da97bb94d9f81e14c65f3213d34
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164084
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/editeng/source/editeng/editstt2.hxx 
b/editeng/source/editeng/editstt2.hxx
index 09e7f02e1831..8cc09ff5dbe0 100644
--- a/editeng/source/editeng/editstt2.hxx
+++ b/editeng/source/editeng/editstt2.hxx
@@ -88,9 +88,6 @@ public:
     bool    DoAutoComplete() const
                 { return bool( nControlBits & EEControlBits::AUTOCOMPLETE ); }
 
-    bool    DoFormat100() const
-                { return bool( nControlBits & EEControlBits::FORMAT100 ); }
-
     bool    ULSpaceSummation() const
                 { return bool( nControlBits & EEControlBits::ULSPACESUMMATION 
); }
 
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 31f9b156962c..41803a52eb64 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -718,8 +718,6 @@ private:
     EditPaM             ImpFastInsertText( EditPaM aPaM, const OUString& rStr 
);
     EditPaM             ImpFastInsertParagraph( sal_Int32 nPara );
 
-    bool                ImpCheckRefMapMode();
-
     bool                ImplHasText() const;
 
     void                ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, 
sal_Int32 nEnd, std::vector<sal_Int32>& rArray );
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 77e3933c085f..b6dfc01f1e5b 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -137,8 +137,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* 
pItemPool ) :
 {
     maStatus.GetControlWord() =  EEControlBits::USECHARATTRIBS | 
EEControlBits::DOIDLEFORMAT |
                                 EEControlBits::PASTESPECIAL | 
EEControlBits::UNDOATTRIBS |
-                                EEControlBits::ALLOWBIGOBJS | 
EEControlBits::RTFSTYLESHEETS |
-                                EEControlBits::FORMAT100;
+                                EEControlBits::ALLOWBIGOBJS | 
EEControlBits::RTFSTYLESHEETS;
 
     maSelEngine.SetFunctionSet(&maSelFuncSet);
 
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 0c8b9bae8223..e5816803f7ce 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -413,7 +413,6 @@ void ImpEditEngine::FormatDoc()
     bool bGrow = false;
 
     // Here already, so that not always in CreateLines...
-    bool bMapChanged = ImpCheckRefMapMode();
     sal_Int32 nParaCount = GetParaPortions().Count();
     o3tl::sorted_vector<sal_Int32> aRepaintParas;
     aRepaintParas.reserve(nParaCount);
@@ -506,37 +505,9 @@ void ImpEditEngine::FormatDoc()
     mbIsFormatting = false;
     mbFormatted = true;
 
-    if ( bMapChanged )
-        GetRefDevice()->Pop();
-
     CallStatusHdl();    // If Modified...
 }
 
-bool ImpEditEngine::ImpCheckRefMapMode()
-{
-    bool bChange = false;
-
-    if ( maStatus.DoFormat100() )
-    {
-        MapMode aMapMode( GetRefDevice()->GetMapMode() );
-        if ( aMapMode.GetScaleX().GetNumerator() != 
aMapMode.GetScaleX().GetDenominator() )
-            bChange = true;
-        else if ( aMapMode.GetScaleY().GetNumerator() != 
aMapMode.GetScaleY().GetDenominator() )
-            bChange = true;
-
-        if ( bChange )
-        {
-            Fraction Scale1( 1, 1 );
-            aMapMode.SetScaleX( Scale1 );
-            aMapMode.SetScaleY( Scale1 );
-            GetRefDevice()->Push();
-            GetRefDevice()->SetMapMode( aMapMode );
-        }
-    }
-
-    return bChange;
-}
-
 void ImpEditEngine::CheckAutoPageSize()
 {
     Size aPrevPaperSize( GetPaperSize() );
@@ -705,9 +676,6 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 
     // Initialization...
 
-    // Always format for 100%:
-    bool bMapChanged = ImpCheckRefMapMode();
-
     if (rParaPortion.GetLines().Count() == 0)
     {
         rParaPortion.GetLines().Append(std::make_unique<EditLine>());
@@ -1816,9 +1784,6 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 
     bool bHeightChanged = FinishCreateLines(rParaPortion);
 
-    if ( bMapChanged )
-        GetRefDevice()->Pop();
-
     GetRefDevice()->Pop();
 
     return bHeightChanged;
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 4e839254df1c..664ed15e416f 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -48,14 +48,13 @@ enum class EEControlBits
     AUTOPAGESIZEX      = 0x00200000,  // Adjust paper width to Text
     AUTOPAGESIZEY      = 0x00400000,  // Adjust paper height to Text
     AUTOPAGESIZE       = (AUTOPAGESIZEX | AUTOPAGESIZEY),
-    FORMAT100          = 0x01000000,  // Always format to 100%
-    ULSPACESUMMATION   = 0x02000000,  // MS Compat: sum SA and SB, not maximum 
value
-    SINGLELINE         = 0x04000000,  // One line for all text
-    STACKED            = 0x08000000,  // Same as ONECHARPERLINE (used in 
impress)
+    ULSPACESUMMATION   = 0x01000000,  // MS Compat: sum SA and SB, not maximum 
value
+    SINGLELINE         = 0x02000000,  // One line for all text
+    STACKED            = 0x04000000,  // Same as ONECHARPERLINE (used in 
impress)
 };
 namespace o3tl
 {
-    template<> struct typed_flags<EEControlBits> : 
is_typed_flags<EEControlBits, 0x0fffffff> {};
+    template<> struct typed_flags<EEControlBits> : 
is_typed_flags<EEControlBits, 0x07ffffff> {};
 }
 
 enum class EVControlBits
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index b9dcbf68bef2..ae1aac3e715d 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -393,12 +393,6 @@ tools::Long ScColumn::GetNeededSize(
 
         const bool bPrevUpdateLayout = pEngine->SetUpdateLayout( false );
         bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER );
-        EEControlBits nCtrl = pEngine->GetControlWord();
-        if ( bTextWysiwyg )
-            nCtrl |= EEControlBits::FORMAT100;
-        else
-            nCtrl &= ~EEControlBits::FORMAT100;
-        pEngine->SetControlWord( nCtrl );
         MapMode aOld = pDev->GetMapMode();
         pDev->SetMapMode( aHMMMode );
         pEngine->SetRefDevice( pDev );
@@ -554,20 +548,6 @@ tools::Long ScColumn::GetNeededSize(
             nValue = bInPrintTwips ?
                     o3tl::toTwips(aTextSize, o3tl::Length::mm100) :
                     pDev->LogicToPixel(Size(0, aTextSize), aHMMMode).Height();
-
-            // With non-100% zoom and several lines or paragraphs, don't 
shrink below the result with FORMAT100 set
-            if ( !bTextWysiwyg && ( rZoomY.GetNumerator() != 1 || 
rZoomY.GetDenominator() != 1 ) &&
-                 ( pEngine->GetParagraphCount() > 1 || ( bBreak && 
pEngine->GetLineCount(0) > 1 ) ) )
-            {
-                pEngine->SetControlWord( nCtrl | EEControlBits::FORMAT100 );
-                pEngine->QuickFormatDoc( true );
-                aTextSize = pEngine->GetTextHeight();
-                tools::Long nSecondValue = bInPrintTwips ?
-                        o3tl::toTwips(aTextSize, o3tl::Length::mm100) :
-                        pDev->LogicToPixel(Size(0, aTextSize), 
aHMMMode).Height();
-                if ( nSecondValue > nValue )
-                    nValue = nSecondValue;
-            }
         }
 
         if ( nValue && bAddMargin )
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1b261ac46d77..6be4ea77cf7e 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -906,21 +906,6 @@ void ScInputHandler::UpdateRefDevice()
         return;
 
     bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
-    bool bInPlace = pActiveViewSh && 
pActiveViewSh->GetViewFrame().GetFrame().IsInPlace();
-    EEControlBits nCtrl = mpEditEngine->GetControlWord();
-    bool bFormat100Percent = bTextWysiwyg || bInPlace;
-    // FORMAT100 is an odd thing only used by calc since #i51508# and possibly
-    // redundant at this stage by resolution independent text layout and
-    // rendering, at least for the kit case we want the text layout to be done
-    // accurately at the provided scaling of the reference device
-    if (comphelper::LibreOfficeKit::isActive())
-        bFormat100Percent = false;
-
-    if (bFormat100Percent)
-        nCtrl |= EEControlBits::FORMAT100;    // EditEngine default: always 
format for 100%
-    else
-        nCtrl &= ~EEControlBits::FORMAT100;   // when formatting for screen, 
use the actual MapMode
-    mpEditEngine->SetControlWord( nCtrl );
     if ( bTextWysiwyg && pActiveViewSh )
         mpEditEngine->SetRefDevice( 
pActiveViewSh->GetViewData().GetDocument().GetPrinter() );
     else
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 73c7e13d9031..2b6b5a27100b 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2270,8 +2270,6 @@ void ScOutputData::InitOutputEditEngine()
             nCtrl &= ~EEControlBits::MARKFIELDS;
         else
             nCtrl &= ~EEControlBits::MARKURLFIELDS;   // URLs not shaded for 
output
-        if ( eType == OUTTYPE_WINDOW && mpRefDevice == pFmtDevice )
-            nCtrl &= ~EEControlBits::FORMAT100;       // use the actual MapMode
         mxOutputEditEngine->SetControlWord( nCtrl );
         mxOutputEditEngine->EnableAutoColor( mbUseStyleColor );
     }

Reply via email to