[M-git] Mahogany sources repository. branch master updated. v0.67-695-g582029d
"Vadim Zeitlin" <[email protected]> Tue, 25 Feb 2014 14:35:46 +0000
| Newsgroups | gmane.mail.mahogany.cvs |
|---|---|
| Message-ID | <[email protected]> |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".
The branch, master has been updated
via 582029d01c3d67335e7749f35e3ff7ba7443d6d0 (commit)
via 22b2486eae0bf4002e280b1c98ab5fbce6a4b11f (commit)
via 449c2e0279784a6acf4b9bf059b889e0b43d5e27 (commit)
via dcea4b0aa4e72db4de94df50beb8edfb924d7ae4 (commit)
via f6a21151bf4cdf9a67f3549f9cde64c07a650f0b (commit)
via a818154e1234059df6a8bc5b70d4940708384b5b (commit)
via 00cf867e8ef87b952c1fea197d6372b58b86bc6c (commit)
from def429bacf3d73fe1f7e41995f679c6159289137 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 582029d01c3d67335e7749f35e3ff7ba7443d6d0
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jan 28 14:41:10 2014 +0100
Compilation fixes for building with wxWidgets 2.8 compatibility disabled.
Also fix (suppress, really) warnings when building with wxWidgets 3.1-trunk.
diff --git a/include/gui/wxllist.h b/include/gui/wxllist.h
index 7343745..c8cc95f 100644
--- a/include/gui/wxllist.h
+++ b/include/gui/wxllist.h
@@ -390,9 +390,13 @@ public:
wxFontCacheEntry(int family, int size, int style, int weight,
bool underline,
wxFontEncoding encoding)
- : m_Font(size, family,
- style, weight, underline,
- wxEmptyString, encoding)
+ : m_Font(size,
+ static_cast<wxFontFamily>(family),
+ static_cast<wxFontStyle>(style),
+ static_cast<wxFontWeight>(weight),
+ underline,
+ wxEmptyString,
+ encoding)
{
m_Family = family;
m_Size = size;
diff --git a/src/gui/wxMDialogs.cpp b/src/gui/wxMDialogs.cpp
index debc1e8..a90261b 100644
--- a/src/gui/wxMDialogs.cpp
+++ b/src/gui/wxMDialogs.cpp
@@ -2814,7 +2814,7 @@ MProgressInfo::MProgressInfo(wxWindow *parent,
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_FRAME_STYLE |
- wxTINY_CAPTION_HORIZ |
+ wxTINY_CAPTION |
(parent ? wxFRAME_FLOAT_ON_PARENT : wxSTAY_ON_TOP)
);
diff --git a/src/gui/wxMGuiUtils.cpp b/src/gui/wxMGuiUtils.cpp
index 9a70560..e1383fc 100644
--- a/src/gui/wxMGuiUtils.cpp
+++ b/src/gui/wxMGuiUtils.cpp
@@ -121,15 +121,10 @@ CreateFontFromDesc(const String& fontDesc, int fontSize, int fontFamily)
// given size and family if we have [either of] them
if ( !font.Ok() && (fontSize != -1 || fontFamily != wxFONTFAMILY_DEFAULT) )
{
- font = wxFont
- (
- fontSize == -1 ? wxNORMAL_FONT->GetPointSize()
- : fontSize,
- fontFamily == wxFONTFAMILY_DEFAULT ? wxNORMAL_FONT->GetFamily()
- : fontFamily,
- wxFONTSTYLE_NORMAL,
- wxFONTWEIGHT_NORMAL
- );
+ if ( fontSize == -1 )
+ fontSize = wxNORMAL_FONT->GetPointSize();
+
+ font = wxFontInfo(fontSize).Family(static_cast<wxFontFamily>(fontFamily));
}
return font;
diff --git a/src/gui/wxOptionsDlg.cpp b/src/gui/wxOptionsDlg.cpp
index 09d91e0..0bef43f 100644
--- a/src/gui/wxOptionsDlg.cpp
+++ b/src/gui/wxOptionsDlg.cpp
@@ -5340,32 +5340,32 @@ void wxConfigSourcesDialog::ExchangeRows(int row1, int row2)
void wxConfigSourcesDialog::OnUpdateButtonUp(wxUpdateUIEvent& event)
{
// first row must always remain on top, so row 1 can't be moved up
- event.Enable( m_sources->GetCursorRow() > 1 );
+ event.Enable( m_sources->GetGridCursorRow() > 1 );
}
void wxConfigSourcesDialog::OnUpdateButtonDown(wxUpdateUIEvent& event)
{
// first row can't be moved down as it can't be moved at all and the last
// row can't be moved down any more neither
- const int row = m_sources->GetCursorRow();
+ const int row = m_sources->GetGridCursorRow();
event.Enable( row > 0 && row < m_sources->GetNumberRows() - 1 );
}
void wxConfigSourcesDialog::OnUpdateButtonDelete(wxUpdateUIEvent& event)
{
// first row can't be deleted, we always have local config
- event.Enable( m_sources->GetCursorRow() > 0 );
+ event.Enable( m_sources->GetGridCursorRow() > 0 );
}
void wxConfigSourcesDialog::OnButtonUp(wxCommandEvent& WXUNUSED(event))
{
- const int row = m_sources->GetCursorRow();
+ const int row = m_sources->GetGridCursorRow();
ExchangeRows(row, row - 1);
}
void wxConfigSourcesDialog::OnButtonDown(wxCommandEvent& WXUNUSED(event))
{
- const int row = m_sources->GetCursorRow();
+ const int row = m_sources->GetGridCursorRow();
ExchangeRows(row, row + 1);
}
@@ -5376,7 +5376,7 @@ void wxConfigSourcesDialog::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
void wxConfigSourcesDialog::OnButtonDelete(wxCommandEvent& WXUNUSED(event))
{
- m_sources->DeleteRows(m_sources->GetCursorRow());
+ m_sources->DeleteRows(m_sources->GetGridCursorRow());
}
// ----------------------------------------------------------------------------
diff --git a/src/gui/wxllist.cpp b/src/gui/wxllist.cpp
index 0e1be45..4c0147c 100644
--- a/src/gui/wxllist.cpp
+++ b/src/gui/wxllist.cpp
@@ -2631,7 +2631,7 @@ wxLayoutList::Draw(wxDC &dc,
Layout(dc, bottom);
ApplyStyle(m_DefaultStyleInfo, dc);
- wxBrush brush(m_CurrentStyleInfo.m_bg, wxSOLID);
+ wxBrush brush(m_CurrentStyleInfo.m_bg);
dc.SetBrush(brush);
dc.SetBackgroundMode(wxTRANSPARENT);
diff --git a/src/gui/wxlwindow.cpp b/src/gui/wxlwindow.cpp
index a340004..a24c009 100644
--- a/src/gui/wxlwindow.cpp
+++ b/src/gui/wxlwindow.cpp
@@ -1017,9 +1017,8 @@ wxLayoutWindow::InternalPaint(const wxRect *updateRect)
wxMemoryDC dcMem;
dcMem.SelectObject(*m_bitmap);
dcMem.SetDeviceOrigin(0,0);
- dcMem.SetBackground(wxBrush(m_llist->GetDefaultStyleInfo().GetBGColour(),wxSOLID));
- dcMem.SetPen(wxPen(m_llist->GetDefaultStyleInfo().GetBGColour(),
- 0,wxTRANSPARENT));
+ dcMem.SetBackground(m_llist->GetDefaultStyleInfo().GetBGColour());
+ dcMem.SetPen(*wxTRANSPARENT_PEN);
dcMem.SetLogicalFunction(wxCOPY);
dcMem.Clear();
WXLO_TIMER_STOP(TmpTimer);
commit 22b2486eae0bf4002e280b1c98ab5fbce6a4b11f
Author: Vadim Zeitlin <[email protected]>
Date: Mon Dec 23 00:17:37 2013 +0100
Avoid recognizing a line of dashes as part of a wrapped URL.
This often results in false positives as lines of dashes are often used as
section delimiters in emails (especially automatically-generated ones, such as
those sent by Review Board), but consecutive dashes almost never appear in
URLs, so assume they are not part of it.
diff --git a/src/util/matchurl.cpp b/src/util/matchurl.cpp
index c219fa1..029a39b 100644
--- a/src/util/matchurl.cpp
+++ b/src/util/matchurl.cpp
@@ -726,6 +726,12 @@ match:
break;
}
+ // another special case: subsequent dashes are very unusual in URLs
+ // but often used as separator lines, so we assume that they indicate
+ // the end of the URL if we find them on the next line.
+ if ( p[0] == '-' && p[1] == '-' )
+ break;
+
// it might be a wrapped URL but it might be not: it seems like we
// get way too many false positives if we suppose that it's always
// the case... so restrict the wrapped URLs detection to the case
commit 449c2e0279784a6acf4b9bf059b889e0b43d5e27
Author: Vadim Zeitlin <[email protected]>
Date: Mon Dec 23 00:14:30 2013 +0100
Detect wrapped URLs even if there is a space before the new line.
It may happen that the URL is wrapped not quite at the end of a line but
before some spaces preceding it, still recognize it in this case.
diff --git a/src/util/matchurl.cpp b/src/util/matchurl.cpp
index 49a72ab..c219fa1 100644
--- a/src/util/matchurl.cpp
+++ b/src/util/matchurl.cpp
@@ -669,17 +669,23 @@ match:
// URLs are frequently so long that they're spread across multiple
// lines, so try to see if this might be the case here
//
- // first of all: is it at the end of line and can it be continued on
- // the next one? also check if it's really long enough to be wrapped:
+ // first of all we need to check whether it is at the end of line but
+ // we should allow some trailing spaces
+ const wxChar* q = p;
+ while ( *q == ' ' )
+ q++;
+
+ if ( q[0] != '\r' || q[1] != '\n' )
+ break; // not at the line end
+
+ // also check if it's really long enough to be wrapped:
// the short URLs normally shouldn't be wrapped
static const size_t URL_WRAP_LEN = 30; // min len of wrapped URL
- if ( p[0] != '\r' || p[1] != '\n'
- || lenURL < URL_WRAP_LEN
- || !IsURLChar(p[2]) )
- {
- // it isn't
- break;
- }
+ if ( lenURL < URL_WRAP_LEN )
+ break; // too short
+
+ if ( !IsURLChar(q[2]) )
+ break; // doesn't seem to be continued on the next line
// heuristic text for end of URL detection
if ( p - start > 5 && !CanBeWrapped(p) )
@@ -688,7 +694,7 @@ match:
break;
}
- p += 2; // go to the start of next line
+ p = q + 2; // go to the start of next line
// Check that the beginning of next line is not the start of
// another URL.
@@ -708,7 +714,7 @@ match:
// check whether the next line starts with a word -- this is a good
// indication that the URL hasn't wrapped
- const wxChar *q = p;
+ q = p;
while ( wxIsalpha(*q) )
q++;
commit dcea4b0aa4e72db4de94df50beb8edfb924d7ae4
Author: Vadim Zeitlin <[email protected]>
Date: Mon Dec 23 00:13:34 2013 +0100
Fix bug preventing URLs in last message line from being highlighted.
Don't compare the beginning of the URL with the start of the next line if
there is no next line. This test always failed for the URLs in the last line
of the message preventing them from being highlighted.
diff --git a/src/modules/viewflt/QuoteURL.cpp b/src/modules/viewflt/QuoteURL.cpp
index d33b374..aaf4b78 100644
--- a/src/modules/viewflt/QuoteURL.cpp
+++ b/src/modules/viewflt/QuoteURL.cpp
@@ -304,7 +304,8 @@ QuoteURLFilter::DoProcess(String& text,
// and look for all URLs on the current line
const wxChar *endURL = lineCur;
- while ( startURL && (lineCur <= startURL && startURL < lineNext) )
+ while ( startURL &&
+ (lineCur <= startURL && (!lineNext || startURL < lineNext)) )
{
// insert the text before URL (endURL is the end of previous URL, not
// this one or the start of line initially)
commit f6a21151bf4cdf9a67f3549f9cde64c07a650f0b
Author: Vadim Zeitlin <[email protected]>
Date: Tue Nov 26 12:43:19 2013 +0100
Don't pass empty charset to wxFontMapper::CharsetToEncoding().
This results in asserts in debug build and is useless anyhow, an encoded word
without a properly specified encoding is malformed anyhow.
diff --git a/src/mail/MimeDecode.cpp b/src/mail/MimeDecode.cpp
index 7b8ceee..3737034 100644
--- a/src/mail/MimeDecode.cpp
+++ b/src/mail/MimeDecode.cpp
@@ -177,6 +177,14 @@ String DecodeHeaderOnce(const String& in, wxFontEncoding *pEncoding)
break;
}
+ if ( csName.empty() )
+ {
+ wxLogDebug("Invalid encoded word \"%s\": missing encoding.", in);
+ out += wxString(encWordStart, end);
+
+ break;
+ }
+
// pass false to prevent asking the user from here: we can be called
// during non-interactive operations and popping up a dialog for an
// unknown charset can be inappropriate
commit a818154e1234059df6a8bc5b70d4940708384b5b
Author: Vadim Zeitlin <[email protected]>
Date: Tue Nov 26 12:42:40 2013 +0100
Fix harmless but annoying warnings in MSVC 12 build.
Suppress warnings about inconsistent DLL linkage for the functions declared in
Python.h.
diff --git a/include/MPython.h b/include/MPython.h
index 642ff81..f174a4e 100644
--- a/include/MPython.h
+++ b/include/MPython.h
@@ -62,8 +62,24 @@
#undef _DEBUG
#endif
+// Disable warnings about "inconsistent dll linkage" for several functions
+// declared in Python.h without any declspec as they clash with the
+// declarations of these functions when using CRT as a DLL.
+#ifdef CC_MSC
+ #if _MSC_VER >= 1800
+ #pragma warning(push)
+ #pragma warning(disable: 4273)
+ #endif
+#endif
+
#include <Python.h>
+#ifdef CC_MSC
+ #if _MSC_VER >= 1800
+ #pragma warning(pop)
+ #endif
+#endif
+
#ifdef MAHOGANY_DEBUG_WAS_DEFINED
#undef MAHOGANY_DEBUG_WAS_DEFINED
#define _DEBUG
commit 00cf867e8ef87b952c1fea197d6372b58b86bc6c
Author: Vadim Zeitlin <[email protected]>
Date: Tue Nov 19 20:44:15 2013 +0100
Be more forgiving when looking for the end of embedded PGP headers.
There is supposed to be a blank line between the headers and the body of the
message, but some implementations produce a line consisting of a space instead
of a really empty line, so accept this too -- otherwise we don't show the
contents of the message at all if verifying its signature fails, which doesn't
seem right.
diff --git a/src/modules/viewflt/PGP.cpp b/src/modules/viewflt/PGP.cpp
index 47f50fb..fe03b7d 100644
--- a/src/modules/viewflt/PGP.cpp
+++ b/src/modules/viewflt/PGP.cpp
@@ -304,9 +304,33 @@ PGPFilter::DoProcess(String& text,
if ( rc != MCryptoEngine::OK )
{
// beginNext points to the end of BEGIN line, go forward to the
- // end of the headers (signalled by an empty line i.e. 2 EOLs)
- beginNext = wxStrstr(beginNext, _T("\r\n\r\n"));
- if ( beginNext && beginNext < endNext )
+ // end of the headers.
+ //
+ // Normally the end of the headers must be signalled by a blank
+ // line, but in practice some implementations, notably Enigmail
+ // used with Thunderbird, put a space in this "empty" line, so
+ // accept any line containing only spaces as indicating the end
+ // of headers.
+ const wxChar* startBody = beginNext;
+ for ( ;; )
+ {
+ startBody = wxStrstr(startBody, _T("\r\n"));
+ if ( !startBody || startBody >= endNext )
+ break; // end of headers not found
+
+ startBody += 2; // skip "\r\n" we just matched
+ while ( *startBody == ' ' )
+ startBody++;
+
+ if ( startBody[0] == '\r' && startBody[1] == '\n' )
+ {
+ // we found the end of the headers
+ startBody += 2;
+ break;
+ }
+ }
+
+ if ( startBody && startBody < endNext )
{
// endNext currently points to the end of END PGP SIGNATURE
// line, rewind to the PGP_BEGIN_SIG line
@@ -336,7 +360,7 @@ PGPFilter::DoProcess(String& text,
if ( pc > start )
{
- out = String(beginNext + 4, pc - 1);
+ out = String(startBody, pc - 1);
}
break;
-----------------------------------------------------------------------
Summary of changes:
include/MPython.h | 16 ++++++++++++++++
include/gui/wxllist.h | 10 +++++++---
src/gui/wxMDialogs.cpp | 2 +-
src/gui/wxMGuiUtils.cpp | 13 ++++---------
src/gui/wxOptionsDlg.cpp | 12 ++++++------
src/gui/wxllist.cpp | 2 +-
src/gui/wxlwindow.cpp | 5 ++---
src/mail/MimeDecode.cpp | 8 ++++++++
src/modules/viewflt/PGP.cpp | 32 ++++++++++++++++++++++++++++----
src/modules/viewflt/QuoteURL.cpp | 3 ++-
src/util/matchurl.cpp | 34 +++++++++++++++++++++++-----------
11 files changed, 98 insertions(+), 39 deletions(-)
hooks/post-receive
--
Mahogany sources repository.
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk