diff --git a/include/znc/Utils.h b/include/znc/Utils.h index 28766a17..b53cefa7 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -142,17 +142,16 @@ public: * * @param uPreferredWidth If width of table is bigger than this, text in cells will be wrapped to several lines, if possible */ - explicit CTable(size_type uPreferredWidth = 110) : m_vsHeaders(), m_vuMaxWidths(), m_vuMinWidths(), m_vbWrappable(), m_uPreferredWidth(uPreferredWidth), m_vsOutput() {} + CTable() : m_vsHeaders(), m_vsOutput() {} virtual ~CTable() {} /** Adds a new column to the table. * Please note that you should add all columns before starting to fill * the table! * @param sName The name of the column. - * @param bWrappable True if long lines can be wrapped in the same cell. * @return false if a column by that name already existed. */ - bool AddColumn(const CString& sName, bool bWrappable = true); + bool AddColumn(const CString& sName); /** Adds a new row to the table. * After calling this you can fill the row with content. @@ -176,14 +175,6 @@ public: */ bool GetLine(unsigned int uIdx, CString& sLine) const; - /** Return the width of the given column. - * Please note that adding and filling new rows might change the - * result of this function! - * @param uIdx The index of the column you are interested in. - * @return The width of the column. - */ - CString::size_type GetColumnWidth(unsigned int uIdx) const; - /// Completely clear the table. void Clear(); @@ -195,15 +186,10 @@ public: private: unsigned int GetColumnIndex(const CString& sName) const; VCString Render() const; - static VCString WrapWords(const CString& s, size_type uWidth); protected: // TODO: cleanup these fields before 1.7.0 (I don't want to break ABI) VCString m_vsHeaders; - std::vector m_vuMaxWidths; // Column don't need to be bigger than this - std::vector m_vuMinWidths; // Column can't be thiner than this - std::vector m_vbWrappable; - size_type m_uPreferredWidth; mutable VCString m_vsOutput; // Rendered table }; diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index 4e5a742b..d04ce62b 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -444,7 +444,7 @@ void CClient::UserCommand(CString& sLine) { CString sStatus = pChan->IsOn() ? (pChan->IsDetached() ? "Detached" : "Joined") : (pChan->IsDisabled() ? "Disabled" : "Trying"); CTable Table; - Table.AddColumn(sChan, false); + Table.AddColumn(sChan); Table.AddColumn(sStatus); Table.AddRow(); diff --git a/src/Utils.cpp b/src/Utils.cpp index 284e8ad0..ecb3c935 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -546,7 +546,7 @@ void CUtils::SetMessageTags(CString& sLine, const MCString& mssTags) { } } -bool CTable::AddColumn(const CString& sName, bool bWrappable) { +bool CTable::AddColumn(const CString& sName) { for (const CString& sHeader : m_vsHeaders) { if (sHeader.Equals(sName)) { return false; @@ -554,7 +554,6 @@ bool CTable::AddColumn(const CString& sName, bool bWrappable) { } m_vsHeaders.push_back(sName); - m_vbWrappable.push_back(bWrappable); return true; } @@ -618,10 +617,6 @@ VCString CTable::Render() const { return vsOutput; } -VCString CTable::WrapWords(const CString& s, size_type uWidth) { - return VCString(); -} - unsigned int CTable::GetColumnIndex(const CString& sName) const { for (unsigned int i = 0; i < m_vsHeaders.size(); i++) { if (m_vsHeaders[i] == sName) @@ -633,16 +628,9 @@ unsigned int CTable::GetColumnIndex(const CString& sName) const { return (unsigned int) -1; } -CString::size_type CTable::GetColumnWidth(unsigned int uIdx) const { - return 0; -} - void CTable::Clear() { clear(); m_vsHeaders.clear(); - m_vuMaxWidths.clear(); - m_vuMinWidths.clear(); - m_vbWrappable.clear(); m_vsOutput.clear(); }